java.sql.SQLException: Cannot close a connection while a transaction is still active.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Hibernate JIRA by Marcel, 1 year ago
Cannot close a connection while a transaction is still active.
via Hibernate JIRA by Marcel, 1 year ago
Cannot close a connection while a transaction is still active.
via GitHub by jcoady9
, 2 years ago
Cannot close a connection while a transaction is still active.
via GitHub by jcoady9
, 2 years ago
Cannot close a connection while a transaction is still active.
via GitHub by jcoady9
, 2 years ago
Cannot close a connection while a transaction is still active.
via GitHub by jcoady9
, 2 years ago
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.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.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.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

Once, 1 year ago
Once, 5 months ago
Once, 7 months ago
Once, 7 months ago
81 times, 1 year ago
1 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.