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

hugo (JIRA) noreply at atlassian.com
Wed Dec 5 05:03:56 EST 2007


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

hugo commented on HHH-2694:
---------------------------

I do experiment the same problem:

Hibernate: 3.1.3
c3p0: 0.9.1
MySQL: 5.0.26-standard

INFO  [main] org.hibernate.impl.SessionFactoryImpl () - 2007-12-04 18:52:55,342 - closing
INFO  [main] org.hibernate.tool.hbm2ddl.SchemaExport () - 2007-12-04 18:52:55,357 - Running hbm2ddl schema export
INFO  [main] org.hibernate.tool.hbm2ddl.SchemaExport () - 2007-12-04 18:52:55,363 - exporting generated schema to database
ERROR [main] org.hibernate.tool.hbm2ddl.SchemaExport () - 2007-12-04 18:52:55,386 - schema export unsuccessful
java.sql.SQLException: com.mchange.v2.c3p0.PoolBackedDataSource at 7b071780 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource at ca707eb9 [ acquireIncrement -> 1, acquireRetryAttempts -> 3, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> C3P0TestTable, breakAfterAcquireFailure -> true, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> z8kflt7q1a4scfrwaxp0b|6a1fbe, idleConnectionTestPeriod -> 600, initialPoolSize -> 1, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1200, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 75, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource at d53284ee [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> z8kflt7q1a4scfrwaxp0b|1685be9, jdbcUrl -> jdbc:mysql://10.0.0.43:3306/ks_hugo, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> z8kflt7q1a4scfrwaxp0b|f2db2d, numHelperThreads -> 3 ] has been closed() -- you can no longer use it.
        at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.assertCpds(AbstractPoolBackedDataSource.java:447)
        at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getPoolManager(AbstractPoolBackedDataSource.java:459)
        at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
        at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:35)
        at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:27)
        at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:178)
        at org.hibernate.tool.hbm2ddl.SchemaExport.drop(SchemaExport.java:141)
        at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:765)

Indeed, I do not have the problem anymore if I deactivate c3p0.

Does someone know if the fix is more likely to be found in future release of hibernate, or in future version of c3p0 ?

> 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
>         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 at fced4 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource at 9505f [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 9505f, idleConnectionTestPeriod -> 100, initialPoolSize -> 10, maxIdleTime -> 100, maxPoolSize -> 100, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource at 80cac9 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 80cac9, jdbcUrl -> jdbc:hsqldb:., properties -> {user=******, password=******, autocommit=true, release_mode=auto} ], preferredTestQuery -> 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

       




More information about the hibernate-issues mailing list