java.sql.SQLException: You can't operate on a closed connection!!!

Hibernate JIRA | Sven Henckel | 1 decade ago
  1. 0

    Hibernate Community • View topic - Problem with SchemaExport and C3P0

    hibernate.org | 8 months ago
    java.sql.SQLException: You can't operate on a closed connection!!!
  2. 0

    I have a problem with the schema export and C3P0. Using the following code throws a SQLException (You can't operate on a closed connection!!!). When uncommenting the line "schema.drop(true, true)" it works fine... It also works when replacing the SchemaExport with the old version (v. 1.3) from Hibernate 3.0 rc1. CODE: public static void main(String[] args) { final SchemaExport schemaExport = new SchemaExport(Li2DHibernateUtil.getConfiguration()); schemaExport.setOutputFile(DDL_SCHEMA_OUTPUT); schemaExport.drop(true, true); schemaExport.create(true, true); System.exit(0); } EXCEPTION: ERROR 07.04.2005 10:15:31,502 org.hibernate.tool.hbm2ddl.SchemaExport (SchemaExport:execute:180) - schema export unsuccessful java.sql.SQLException: You can't operate on a closed connection!!! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:68) at com.mchange.v2.c3p0.impl.NewProxyConnection.getAutoCommit(NewProxyConnection.java:815) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:132) at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:100) at de.company.product.tools.DDLManager.main(DDLManager.java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) Caused by: java.lang.NullPointerException at com.mchange.v2.c3p0.impl.NewProxyConnection.getAutoCommit(NewProxyConnection.java:809) ... 8 more HIBERNATE.PROPERIES: hibernate.c3p0.max_size 150 hibernate.c3p0.min_size 3 hibernate.c3p0.timeout 0 hibernate.c3p0.max_statements 0 hibernate.c3p0.idle_test_period 0 hibernate.c3p0.acquire_increment 1 C3P0.PROPERTIES: c3p0.initialPoolSize=3 c3p0.autoCommitOnClose=false c3p0.forceIgnoreUnresolvedTransactions=false com.mchange.v2.log.MLog=com.mchange.v2.log.log4j.Log4jMLog For more information see: http://forum.hibernate.org/viewtopic.php?p=2238003

    Hibernate JIRA | 1 decade ago | Sven Henckel
    java.sql.SQLException: You can't operate on a closed connection!!!
  3. 0

    I have a problem with the schema export and C3P0. Using the following code throws a SQLException (You can't operate on a closed connection!!!). When uncommenting the line "schema.drop(true, true)" it works fine... It also works when replacing the SchemaExport with the old version (v. 1.3) from Hibernate 3.0 rc1. CODE: public static void main(String[] args) { final SchemaExport schemaExport = new SchemaExport(Li2DHibernateUtil.getConfiguration()); schemaExport.setOutputFile(DDL_SCHEMA_OUTPUT); schemaExport.drop(true, true); schemaExport.create(true, true); System.exit(0); } EXCEPTION: ERROR 07.04.2005 10:15:31,502 org.hibernate.tool.hbm2ddl.SchemaExport (SchemaExport:execute:180) - schema export unsuccessful java.sql.SQLException: You can't operate on a closed connection!!! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:68) at com.mchange.v2.c3p0.impl.NewProxyConnection.getAutoCommit(NewProxyConnection.java:815) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:132) at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:100) at de.company.product.tools.DDLManager.main(DDLManager.java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) Caused by: java.lang.NullPointerException at com.mchange.v2.c3p0.impl.NewProxyConnection.getAutoCommit(NewProxyConnection.java:809) ... 8 more HIBERNATE.PROPERIES: hibernate.c3p0.max_size 150 hibernate.c3p0.min_size 3 hibernate.c3p0.timeout 0 hibernate.c3p0.max_statements 0 hibernate.c3p0.idle_test_period 0 hibernate.c3p0.acquire_increment 1 C3P0.PROPERTIES: c3p0.initialPoolSize=3 c3p0.autoCommitOnClose=false c3p0.forceIgnoreUnresolvedTransactions=false com.mchange.v2.log.MLog=com.mchange.v2.log.log4j.Log4jMLog For more information see: http://forum.hibernate.org/viewtopic.php?p=2238003

    Hibernate JIRA | 1 decade ago | Sven Henckel
    java.sql.SQLException: You can't operate on a closed connection!!!
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.mchange.v2.c3p0.impl.NewProxyConnection.getAutoCommit()
    2. c3p0:JDBC DataSources/Resource Pools
      NewProxyConnection.getAutoCommit
      1. com.mchange.v2.c3p0.impl.NewProxyConnection.getAutoCommit(NewProxyConnection.java:809)
      1 frame
    3. Hibernate
      SchemaExport.create
      1. org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:132)
      2. org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:100)
      2 frames
    4. de.company.product
      DDLManager.main
      1. de.company.product.tools.DDLManager.main(DDLManager.java:39)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:324)
      4 frames
    6. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
      1 frame