12 Replies Latest reply on Nov 30, 2009 1:07 AM by Tathagat Tathagat

    JDBC commit failed

    guy bashan Apprentice

      Hi,


      I have a Seam web app using mySQL, tomcat JSF and Hibernate.
      When server loads everything is working fine. After about 30 minutes, when trying to access a page in my application I am getting this exception:


      18:50:56,024 ERROR [JDBCTransaction] JDBC commit failed
      com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Connection.close() has already been called. Invalid operation in this state.
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
           at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
           at com.mysql.jdbc.Util.getInstance(Util.java:381)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
           at com.mysql.jdbc.ConnectionImpl.getMutex(ConnectionImpl.java:3018)
           at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1512)
           at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:170)
           at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:146)
           at org.jboss.seam.transaction.HibernateTransaction.commit(HibernateTransaction.java:108)
           at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:613)
           at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:604)
           at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:345)
           at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:245)
           at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
           at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
           at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
           at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
           at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
           at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
           at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
           at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
           at java.lang.Thread.run(Thread.java:619)
      18:50:56,025 WARN  [SeamPhaseListener] uncaught exception, passing to exception handler
      java.lang.IllegalStateException: Could not commit transaction
           at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:625)
           at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:604)
           at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:345)
           at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:245)
           at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
           at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
           at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
           at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
           at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
           at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
           at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
           at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
           at java.lang.Thread.run(Thread.java:619)
      Caused by: org.hibernate.TransactionException: JDBC commit failed
           at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:161)
           at org.jboss.seam.transaction.HibernateTransaction.commit(HibernateTransaction.java:108)
           at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:613)
           ... 48 more
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Connection.close() has already been called. Invalid operation in this state.
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
           at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
           at com.mysql.jdbc.Util.getInstance(Util.java:381)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
           at com.mysql.jdbc.ConnectionImpl.getMutex(ConnectionImpl.java:3018)
           at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1512)
           at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:170)
           at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:146)
           ... 50 more
      18:50:56,026 ERROR [SeamPhaseListener] swallowing exception
      java.lang.IllegalStateException: Could not commit transaction
           at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:625)
           at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:604)
           at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:345)
           at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:245)
           at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
           at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
           at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
           at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
           at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
           at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
           at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
           at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
           at java.lang.Thread.run(Thread.java:619)
      Caused by: org.hibernate.TransactionException: JDBC commit failed
           at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:161)
           at org.jboss.seam.transaction.HibernateTransaction.commit(HibernateTransaction.java:108)
           at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:613)
           ... 48 more
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Connection.close() has already been called. Invalid operation in this state.
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
           at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
           at com.mysql.jdbc.Util.getInstance(Util.java:381)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
           at com.mysql.jdbc.ConnectionImpl.getMutex(ConnectionImpl.java:3018)
           at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1512)
           at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:170)
           at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:146)
           ... 50 more
      



      Only restarting the server recovers from this problem. I have on the server more web applications using database that are working fine with no problems.
      Does anyone have an idea?

        • 1. Re: JDBC commit failed
          Francisco Jose Peredo Noguez Master

          It is a typical problem with JDBC, I guess some of the code you are using is not closing the connections properly.

          • 2. Re: JDBC commit failed
            Arbi Sookazian Master

            Most likely Francisco is correct although it's possible this is a programmer's mistake (premature close of connection somehow?).  This is one of the advantages of using Spring's JdbcTemplate.  It does all the boring, boiler-plate work for you (less code and less headaches!) thus minimizing mistakes.


            That's why I wanted a Seam equivalent of Spring's JdbcTemplate to be developed but every time I bring it up they just say don't re-invent the wheel, re-use it!  Which means you need to integrate Spring with Seam (one of the last chapters in SiA covers this).


            Is anybody actually using Spring's JdbcTemplate with Seam apps?  Sometimes it's not possible to use JPA/Hibernate if your project is using a legacy schema that is not 3NF, lacks FK's, etc.  Plus, JPA 1.0 does not support stored procs...

            • 3. Re: JDBC commit failed
              guy bashan Apprentice

              Thanks for your answers. I upgraded the JDBC driver. I hope it will help. In general, I do no open/close connections manually. Seam and Hibernate manage all for me.
              Regarding the JdbcTemplate: I am not familiar with Spring and with the JdbcTemplate, but I understand what you are saying (Arbi) regarding developing something similar in Seam: You prefer to have all the good stuff in one framework, rather than needing to use 2 frameworks. It saves learning time and resources. After all, from general familiarity with Spring, I believe there are anyway things in Seam that were already invented Spring before... so why not add one more... ;-)

              • 4. Re: JDBC commit failed
                guy bashan Apprentice

                It seems like I didn't got rid of this problem.
                I can't understand where is it coming from. Is there a way of dealing this thing?


                Thanks,
                Guy.

                • 5. Re: JDBC commit failed
                  Tathagat Tathagat Newbie

                  Good morning from Germany.


                  I am having EXACTLY the same problem. Did you come across any solutions?


                  Francisco: Where should I be closing connections in my code? Like Guy mentioned, I also never open or close connections. I defined in components.xml


                  <persistence:hibernate-session-factory name="hibernateSessionFactory"/>
                       <persistence:managed-hibernate-session name="managedHibernateSession"
                                              session-factory="#{hibernateSessionFactory}"/>
                       <transaction:hibernate-transaction session="#{managedHibernateSession}"/>



                  And in my code I just use managedHibernateSession to do DB stuff.


                  Thanks for your help in advance.


                  Cheers
                  T

                  • 6. Re: JDBC commit failed
                    Tathagat Tathagat Newbie

                    Hi Guy.
                    Do you use


                    <property name="hibernate.transaction.flush_before_completion">true</property>



                    in your hibernate.cfg.xml file?


                    Cheers
                    T

                    • 7. Re: JDBC commit failed
                      Tathagat Tathagat Newbie

                      Not sure if you are following this thread anymore, but I believe I solved this problem by using: c3p0 connection pool.


                      Cheers
                      T

                      • 8. Re: JDBC commit failed
                        guy bashan Apprentice

                        Hi Tathagat,
                        Sorry for the late reply...


                        I believe I am using the property: flushbeforecompletion (I am not near the machine to verify for sure...).
                        I am still having this problem and I am also using C3P0. Can you please post an example of your components.xml and hibernate.xml, maybe I did there something wrong...


                        Thanks,
                        Guy

                        • 9. Re: JDBC commit failed
                          guy bashan Apprentice

                          Well? Can you help me with this issue? ;-)

                          • 10. Re: JDBC commit failed
                            Tathagat Tathagat Newbie

                            Hey!
                            Sorry, didn't see the message (How do I subscribe to a particular thread to get automatic notifications on new messages?).


                            This are my C3P0 settings


                            <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
                            
                            <property name="c3p0.acquire_increment">1</property> 
                            <property name="c3p0.idle_test_period">100</property> <!-- seconds --> 
                            <property name="c3p0.max_size">100</property> 
                            <property name="c3p0.max_statements">0</property> 
                            <property name="c3p0.min_size">10</property> 
                            <property name="c3p0.timeout">0</property> <!-- seconds -->



                            Hibernate related settings from components.xml


                            <persistence:hibernate-session-factory name="hibernateSessionFactory"/>
                            <persistence:managed-hibernate-session name="managedHibernateSession"
                                                        session-factory="#{hibernateSessionFactory}"/>
                            <transaction:hibernate-transaction session="#{managedHibernateSession}"/>




                            So what do you have missing in your files? Please let me know if that helped you.


                            My system is running for some days now without crashing.


                            Cheers
                            T

                            • 11. Re: JDBC commit failed
                              guy bashan Apprentice

                              Thanks,
                              I was already managed solving the issue. I was missing this line:


                              <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
                              



                              Therefore Hibernate was not using c3p0. So far my server is working well, but it has been only 2 days.


                              By the way, did you try using the token based remeber me feature (for logging in) with Hibernate?

                              • 12. Re: JDBC commit failed
                                Tathagat Tathagat Newbie

                                Am glad it worked out for you :).


                                No, I actually use no remember me feature.


                                Cheers
                                T