java.sql.SQLException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I have created a small demo application, where after creating an EntityManagerFactory and an EntityManager, I simply do a select query and then close the EntityManager first and then the EntityManagerFactory. But when closing the Factory, I get the following Exception: {code} java.sql.SQLException: Cannot close a connection while a transaction is still active. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.checkForTransactionInProgress(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.close(Unknown Source) at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.stop(DriverManagerConnectionProviderImpl.java:275) at org.hibernate.service.internal.AbstractServiceRegistryImpl.stopService(AbstractServiceRegistryImpl.java:360) at org.hibernate.service.internal.AbstractServiceRegistryImpl.destroy(AbstractServiceRegistryImpl.java:344) at org.hibernate.service.internal.AbstractServiceRegistryImpl.deRegisterChild(AbstractServiceRegistryImpl.java:393) at org.hibernate.service.internal.AbstractServiceRegistryImpl.destroy(AbstractServiceRegistryImpl.java:351) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$ServiceRegistryCloser.sessionFactoryClosed(EntityManagerFactoryBuilderImpl.java:842) at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryClosed(SessionFactoryObserverChain.java:48) at org.hibernate.internal.SessionFactoryImpl.close(SessionFactoryImpl.java:1066) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:339) at com.stackoverflow.jpa.emf.close.example.Run.main(Run.java:24) Caused by: ERROR 25001: Cannot close a connection while a transaction is still active. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 17 more {code} Since I do not use or need any transaction for a simply select query, I think that there might be an error in Hibernate. The Exception will *not* be raised, when I start a transaction before doing the select and close it afterwards. But it seems a bit strange, that I have to do a transaction for every select! See the attachement for the demo application.
    via by Marcel,
  • I have created a small demo application, where after creating an EntityManagerFactory and an EntityManager, I simply do a select query and then close the EntityManager first and then the EntityManagerFactory. But when closing the Factory, I get the following Exception: {code} java.sql.SQLException: Cannot close a connection while a transaction is still active. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.checkForTransactionInProgress(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.close(Unknown Source) at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.stop(DriverManagerConnectionProviderImpl.java:275) at org.hibernate.service.internal.AbstractServiceRegistryImpl.stopService(AbstractServiceRegistryImpl.java:360) at org.hibernate.service.internal.AbstractServiceRegistryImpl.destroy(AbstractServiceRegistryImpl.java:344) at org.hibernate.service.internal.AbstractServiceRegistryImpl.deRegisterChild(AbstractServiceRegistryImpl.java:393) at org.hibernate.service.internal.AbstractServiceRegistryImpl.destroy(AbstractServiceRegistryImpl.java:351) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$ServiceRegistryCloser.sessionFactoryClosed(EntityManagerFactoryBuilderImpl.java:842) at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryClosed(SessionFactoryObserverChain.java:48) at org.hibernate.internal.SessionFactoryImpl.close(SessionFactoryImpl.java:1066) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:339) at com.stackoverflow.jpa.emf.close.example.Run.main(Run.java:24) Caused by: ERROR 25001: Cannot close a connection while a transaction is still active. at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 17 more {code} Since I do not use or need any transaction for a simply select query, I think that there might be an error in Hibernate. The Exception will *not* be raised, when I start a transaction before doing the select and close it afterwards. But it seems a bit strange, that I have to do a transaction for every select! See the attachement for the demo application.
    via by Marcel,
  • error with 'getMixedDrinkList'
    via GitHub by jcoady9
    ,
  • error with 'getLiquorList'
    via GitHub by jcoady9
    ,
  • GitHub comment 50#100696491
    via GitHub by jcoady9
    ,
  • I'm testing new version 3.4.1. I start a maven build with an empty local repo. After a couple of artifact requests, I see the following error in derby.log: ---------------------------------------------------------------- Wed Nov 05 09:39:11 BRST 2014: Booting Derby version The Apache Software Foundation - Apache Derby - 10.9.1.0 - (1344872): instance a816c00e-0149-7fc0-51bb-0000047c4f38 on database directory /home/dlouzado/artifactory-home/data/derby with class loader WebappClassLoader^M context: /artifactory^M delegate: false^M repositories:^M /WEB-INF/classes/^M ----------> Parent Classloader:^M org.apache.catalina.loader.StandardClassLoader@71060c3e^M Loaded from file:/home/dlouzado/apache-tomcat-7.0.56/webapps/artifactory/WEB-INF/lib/derby-10.9.1.0.jar java.vendor=Oracle Corporation java.runtime.version=1.7.0_67-b01 user.dir=/home/dlouzado/apache-tomcat-7.0.56 derby.system.home=null derby.stream.error.file=/home/dlouzado/artifactory-home/logs/derby.log Database Class Loader started - derby.database.classpath='' Wed Nov 05 09:45:41 BRST 2014 Thread[PoolCleaner[1107321498:1415187551317],5,main] ERROR 25001: Cannot close a connection while a transaction is still active. java.sql.SQLException: Cannot close a connection while a transaction is still active. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.checkForTransactionInProgress(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.close(Unknown Source) at org.apache.tomcat.jdbc.pool.PooledConnection.disconnect(PooledConnection.java:331) at org.apache.tomcat.jdbc.pool.PooledConnection.release(PooledConnection.java:496) at org.apache.tomcat.jdbc.pool.ConnectionPool.release(ConnectionPool.java:582) at org.apache.tomcat.jdbc.pool.ConnectionPool.checkIdle(ConnectionPool.java:1000) at org.apache.tomcat.jdbc.pool.ConnectionPool.checkIdle(ConnectionPool.java:981) at org.apache.tomcat.jdbc.pool.ConnectionPool$PoolCleaner.run(ConnectionPool.java:1348) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505) Caused by: java.sql.SQLException: Cannot close a connection while a transaction is still active. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 15 more
    via by dario louzado,
    • java.sql.SQLException: Cannot close a connection while a transaction is still active. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.checkForTransactionInProgress(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.close(Unknown Source) at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.stop(DriverManagerConnectionProviderImpl.java:275) at org.hibernate.service.internal.AbstractServiceRegistryImpl.stopService(AbstractServiceRegistryImpl.java:360) at org.hibernate.service.internal.AbstractServiceRegistryImpl.destroy(AbstractServiceRegistryImpl.java:344) at org.hibernate.service.internal.AbstractServiceRegistryImpl.deRegisterChild(AbstractServiceRegistryImpl.java:393) at org.hibernate.service.internal.AbstractServiceRegistryImpl.destroy(AbstractServiceRegistryImpl.java:351) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$ServiceRegistryCloser.sessionFactoryClosed(EntityManagerFactoryBuilderImpl.java:842) at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryClosed(SessionFactoryObserverChain.java:48) at org.hibernate.internal.SessionFactoryImpl.close(SessionFactoryImpl.java:1066) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:339) at com.stackoverflow.jpa.emf.close.example.Run.main(Run.java:24)

    Users with the same issue

    davidvanlaatumdavidvanlaatum
    1 times, last one,
    jf-astjf-ast
    1 times, last one,
    stigkjstigkj
    1 times, last one,
    andyglickandyglick
    1 times, last one,
    muffinmannenmuffinmannen
    81 times, last one,
    1 more bugmates