JDBC Commit Error

97 views
Skip to first unread message

Jeremy R DeYoung

unread,
Dec 16, 2011, 10:15:08 AM12/16/11
to ColdBox Platform
Is there someone I can pay to help me resolve this error below?

I've emailed this several times to the ColdBox Group and the Railo Group. Both groups tell me its the other parties' issue. 

I am having this happen more and more frequently lately. 

The problem that makes this issue difficult to pin-point is that its completely random. The majority of the time, the site runs perfectly but every so often it creates an error like below.

I've tried adjusting every possible Application.cfc ORM setting and nothing appears to fix the issue. I can tell you that if I wrap a Save ORM statement inside of a cfthread, the error happens about 30% of the time. For example, I have code that inserts data for each first time visitor into a database using ORM. If that ORM statement is wrapped inside of a thread, the error happens 1/3 of the time. I remove the thread and it only happens every once and a while.

Obviously I am doing something wrong and apparently this isn't happening to anyone else but I am at a point where I have to remove all ORM and go back to simple SQL INSERT/UPDATE/SELECT statements or try to find a way to fix the problem.

ANY help would be greatly appreciated. And If I have to pay someone to resolve the problem, I am open since I am desperate to fix this issue.

I am using ColdBox 3.5beta on multiple Operating Systems (Mac OSX, Linux CentOS, & Linux Ubuntu) with Tomcat 6 & 7 - all of which its happen. I am using the latest version of Railo 3.3.1.006

--------------------------

Here is main.cfc - Line 113

    qrcodeService.save(entity=lookup,flush=true);

Here is my Application.cfc's ORM code

<cfset this.datasource = "qz">
<cfset this.ormSettings.flushAtRequestEnd = false>
<cfset this.ormSettings.automanageSession = false>
<cfset this.ormSettings.autogenmap = true>
<cfset this.ormSettings.eventHandling = true>
<cfset this.ormSettings.logSQL = true>
<cfset this.ormSettings.secondaryCacheEnabled = true>
<cfset this.ormSettings.useDBForMapping = true>
<cfset this.ormSettings.savemapping = true>
<cfset this.ormSettings.skipCFCWithError = true>
<cfset this.ormSettings.cacheprovider = "ehCache">
<cfset this.ormSettings.dbcreate = "none">
<cfset this.ormSettings.eventHandler = "model.EventHandler">
<cfset this.ormSettings.cfclocation = "model">


Application Execution Exception CFErrorType=org.hibernate.TransactionException CFMessage=JDBC commit failed CFStackTrace=JDBC commit failed
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:914):914
       at com.mysql.jdbc.Connection.commit(Connection.java:2274):2274
       at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:170):170
       at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:146):146
       at railo.runtime.orm.hibernate.HibernateORMTransaction.end(HibernateORMTransaction.java:52):52
       at railo.runtime.orm.ORMConnection.setAutoCommit(ORMConnection.java:241):241
       at railo.runtime.db.DatasourceManagerImpl.end(DatasourceManagerImpl.java:228):228
       at railo.runtime.tag.Transaction.doFinally(Transaction.java:145):145
       at coldbox.system.orm.hibernate.baseormservice_cfc$cf.udfCall6(/usr/local/tomcat/qz.ms/ROOT/coldbox/system/orm/hibernate/BaseORMService.cfc:1139):1139
       at coldbox.system.orm.hibernate.baseormservice_cfc$cf.udfCall(/usr/local/tomcat/qz.ms/ROOT/coldbox/system/orm/hibernate/BaseORMService.cfc):-1
       at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
       at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
       at railo.runtime.type.UDFImpl.call(UDFImpl.java:384):384
       at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:738):738
       at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1445):1445
       at coldbox.system.orm.hibernate.baseormservice_cfc$cf.udfCall4(/usr/local/tomcat/qz.ms/ROOT/coldbox/system/orm/hibernate/BaseORMService.cfc:682):682
       at coldbox.system.orm.hibernate.baseormservice_cfc$cf.udfCall(/usr/local/tomcat/qz.ms/ROOT/coldbox/system/orm/hibernate/BaseORMService.cfc):-1
       at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
       at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
       at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:377):377
       at railo.runtime.ComponentImpl._call(ComponentImpl.java:609):609
       at railo.runtime.ComponentImpl._call(ComponentImpl.java:495):495
       at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1812):1812
       at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:769):769
       at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1460):1460
       at handlers.main_cfc$cf.udfCall(/usr/local/tomcat/qz.ms/ROOT/handlers/Main.cfc:113):113
       at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
       at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
       at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:377):377
       at railo.runtime.ComponentImpl._call(ComponentImpl.java:609):609
       at railo.runtime.ComponentImpl._call(ComponentImpl.java:495):495
       at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1808):1808
       at railo.runtime.tag.Invoke.doComponent(Invoke.java:210):210
       at railo.runtime.tag.Invoke.doEndTag(Invoke.java:183):183
       at coldbox.system.web.controller_cfc$cf.udfCall5(/usr/local/tomcat/qz.ms/ROOT/coldbox/system/web/Controller.cfc:698):698
       at coldbox.system.web.controller_cfc$cf.udfCall(/usr/local/tomcat/qz.ms/ROOT/coldbox/system/web/Controller.cfc):-1
       at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
       at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
       at railo.runtime.type.UDFImpl.call(UDFImpl.java:384):384
       at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:738):738
       at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1445):1445
       at coldbox.system.web.controller_cfc$cf.udfCall5(/usr/local/tomcat/qz.ms/ROOT/coldbox/system/web/Controller.cfc:583):583
       at coldbox.system.web.controller_cfc$cf.udfCall(/usr/local/tomcat/qz.ms/ROOT/coldbox/system/web/Controller.cfc):-1
       at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
       at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
       at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:377):377
       at railo.runtime.ComponentImpl._call(ComponentImpl.java:609):609
       at railo.runtime.ComponentImpl._call(ComponentImpl.java:495):495
       at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1812):1812
       at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:769):769
       at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1460):1460
       at coldbox.system.coldbox_cfc$cf.udfCall1(/usr/local/tomcat/qz.ms/ROOT/coldbox/system/Coldbox.cfc:223):223
       at coldbox.system.coldbox_cfc$cf.udfCall(/usr/local/tomcat/qz.ms/ROOT/coldbox/system/Coldbox.cfc):-1
       at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
       at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
       at railo.runtime.type.UDFImpl.call(UDFImpl.java:384):384
       at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:738):738
       at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1445):1445
       at application_cfc$cf.udfCall(/usr/local/tomcat/qz.ms/ROOT/Application.cfc:65):65
       at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:215):215
       at railo.runtime.type.UDFImpl._call(UDFImpl.java:434):434
       at railo.runtime.type.UDFImpl.call(UDFImpl.java:384):384
       at railo.runtime.ComponentImpl._call(ComponentImpl.java:608):608
       at railo.runtime.ComponentImpl._call(ComponentImpl.java:495):495
       at railo.runtime.ComponentImpl.call(ComponentImpl.java:1793):1793
       at railo.runtime.listener.ModernAppListener.call(ModernAppListener.java:348):348
       at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:106):106
       at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:23):23
       at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2000):2000
       at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1967):1967
       at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:297):297
       at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722):722
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304):304
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224):224
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169):169
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472):472
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168):168
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100):100
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405):405
       at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200):200
       at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515):515
       at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302):302
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110):1110
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603):603
       at java.lang.Thread.run(Thread.java:679):679


- - - - - - - - - - - - - - - - - 
Jeremy R. DeYoung 
Phone:615.261.8201 
 
RantsFromAMadMan.com 

Jeremy R DeYoung

unread,
Dec 16, 2011, 12:34:20 PM12/16/11
to ColdBox Platform
Here is what Michael @ Railo just updated in the most recent ticket.


does this help to narrow my issue down?


- - - - - - - - - - - - - - - - - 
Jeremy R. DeYoung 
Phone:615.261.8201 
 
RantsFromAMadMan.com 



Luis Majano

unread,
Dec 16, 2011, 6:30:43 PM12/16/11
to col...@googlegroups.com
Jeremy,

This is our code:

transaction{

try{

// Call method

results = arguments.method(argumentCollection=arguments.argCollection);

// commit transaction

transactionCommit();

}

catch(Any e){

// remove pointer

structDelete(request,"cbox_aop_transaction");

// RollBack Transaction

transactionRollback();

//throw it

rethrow;

}

}



As you can see, it is a simple transaction block so it is not a native hibernate transaction, but a native CF transaction block.

--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org

Jeremy R DeYoung

unread,
Dec 20, 2012, 6:40:11 PM12/20/12
to col...@googlegroups.com
FINALLY!!!!

Everyone - I finally, with great assistance from Seth on the Railo Group, got resolution on an issue i've been having for 15 months now.


Basically my ORMService.save( entity ); would fail randomly.

Apparently if you add relaxAutoCommit=true to the JDBC string it resolves the issue. What used to happen every few seconds is now gone. In fact, I did a huge load test on one of my scripts and zero errors. Before I would have many thousand errors.

Just an FYI for anyone having the same issue of random JDBC/Hibernate Commit errors.

Jeremy R DeYoung

unread,
Dec 20, 2012, 6:41:52 PM12/20/12
to ColdBox Platform
oh and to show you how excited I am to have this fix... I share with you the snoopy dance http://www.youtube.com/watch?v=S5-Kyl5Bmx8 which I am now doing....go!






Jeremy R. DeYoung
615.261.8201 • jeremy....@lunarfly.com • LunarFly.com


--

br...@bradwood.com

unread,
Dec 20, 2012, 6:53:36 PM12/20/12
to col...@googlegroups.com
That's excellent news.  Do you have any insight on what the relaxAutoCommit setting does and when it should be set?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 

Jeremy R DeYoung

unread,
Dec 20, 2012, 7:20:54 PM12/20/12
to ColdBox Platform
i wish I could give you a nice answer like "yes" but sadly I have absolutely NO idea. It works with relaxAutoCommit=true and it does not work without it.

what I can tell you is that when you have two ORM transactions that happen at the same time is when it happens. so my guess is that relaxAutoCommit allows for grouping of the SQL commands together as 1 request to mysql. Again that is a complete guess.





Jeremy R. DeYoung
615.261.8201 • jeremy....@lunarfly.com • LunarFly.com


On Thu, Dec 20, 2012 at 5:53 PM, <br...@bradwood.com> wrote:
relaxAutoCommit

Andrew Scott

unread,
Dec 20, 2012, 7:31:27 PM12/20/12
to col...@googlegroups.com
My understanding is that it allows for batch commits / commands etc.


-- 
Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/


On Fri, Dec 21, 2012 at 11:20 AM, Jeremy R DeYoung <jeremy....@lunarfly.com> wrote:
relaxAutoCommit



Reply all
Reply to author
Forward
0 new messages