Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Issues List »

[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2694)
create-drop with c3p0 causes SQLException

Anupam M (JIRA)

2008-08-17


Author LoginPost Reply

  [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_30910 ]

Miro Bezjak commented on HHH-2694:
----------------------------------

Although you already concluded that this is a hibernate issue and not c3p0 I would just like to add (so others can google it easily) that I can confirm this with dbcp and org.hibernate.connection.DBCPConnectionProvider.

Stack trace:
java.lang.NullPointerException
 at org.hibernate.connection.DBCPConnectionProvider.logStatistics(DBCPConnectionProvider.java:247)
 at org.hibernate.connection.DBCPConnectionProvider.getConnection(DBCPConnectionProvider.java:197)
 at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare (SuppliedConnectionProviderConnectionHelper.java:27)
 at org.hibernate.tool.hbm2ddl.SchemaExport.execute (SchemaExport.java:180)
 at org.hibernate.tool.hbm2ddl.SchemaExport.drop (SchemaExport.java:143)
 at org.hibernate.impl.SessionFactoryImpl.close (SessionFactoryImpl.java:810)
 at org.hibernate.ejb.EntityManagerFactoryImpl.close (EntityManagerFactoryImpl.java:46)
 at hr.fer.zemris.vhdllab.dao.impl.EntityManagerUtil.shutdown(EntityManagerUtil.java:95)
 at hr.fer.zemris.vhdllab.dao.impl.EntityManagerFactoryLifecycle.contextDestroyed(EntityManagerFactoryLifecycle.java:35)
 at org.apache.catalina.core.StandardContext.listenerStop (StandardContext.java:3866)
 at org.apache.catalina.core.StandardContext.stop (StandardContext.java:4500)
 at org.apache.catalina.manager.ManagerServlet.undeploy (ManagerServlet.java:1351)
 at org.apache.catalina.manager.HTMLManagerServlet.undeploy (HTMLManagerServlet.java:538)
 at org.apache.catalina.manager.HTMLManagerServlet.doGet (HTMLManagerServlet.java:115)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:690)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:290)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:230)
 at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:175)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke (AuthenticatorBase.java:525)
 at org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
 at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:104)
 at org.apache.catalina.valves.AccessLogValve.invoke (AccessLogValve.java:563)
 at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:261)
 at org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:844)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run (Thread.java:619)

> create-drop with c3p0 causes SQLException
> -----------------------------------------
>
>           Key: HHH-2694
>           URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2694
>         Project: Hibernate3
>       Issue Type: Bug
>   Affects Versions: 3.2.4.sp1
>      Environment: hibernate-entitymanager 3.2.1.ga, c3p0 0.9.0, and postgreSQL 8.1.8 or hsqldb 1.8.7
>        Reporter: Chris Redekop
>        Assignee: Chris Bredesen
>      Attachments: c3p0Test.tar.gz
>
>
> In the attached test application, an EntityManagerFactory is created and then closed.
> Closing the EMF causes line 801 of org.hibernate.impl.SessionFactoryImpl to call getConnectionProvider().close(), which eventually results in c3p0's PooledDataSource being closed.
> Line 808 of org.hibernate.impl.SessionFactoryImpl the calls schemaExport.drop(), which attempts to acquire a connection from the data source and causes the following SQLException.
> java.sql.SQLException: com.mchange.v2.c3p0.PoolBackedDataSource@(protected)!
stQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> fced4, numHelperThreads -> 3 ] has been closed() -- you can no longer use it.
> This exception is swallowed so it does not cause a test error, but it does appear in the console output.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

   

_______________________________________________
hibernate-issues mailing list
hibernate-issues@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-issues
©2008 gg3721.com - Jax Systems, LLC, U.S.A.