[hibernate-issues] [Hibernate-JIRA] Created: (HBX-1145) Warning message "The transaction remains active, [..]" at the end of the hbm2java ant task
Julien Kronegg (JIRA)
noreply at atlassian.com
Fri Oct 2 03:27:52 EDT 2009
Warning message "The transaction remains active, [..]" at the end of the hbm2java ant task
------------------------------------------------------------------------------------------
Key: HBX-1145
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1145
Project: Hibernate Tools
Issue Type: Bug
Components: ant, hbm2java
Affects Versions: 3.2.2
Environment: Hibernate Tools 3.2.2.GA, DB2, Seam 2.1.2.GA/seam-gen, http://anonsvn.jboss.org/repos/hibernate/branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/cfg/JDBCBinder.java, http://anonsvn.jboss.org/repos/hibernate/core/trunk/core/src/main/java/org/hibernate/connection/DriverManagerConnectionProvider.java
Reporter: Julien Kronegg
Priority: Minor
When doing a hbm2java ant task to generate entities from the database, an exception occurs when closing the connection pool if transactions are used.
INFO: cleaning up connection pool: jdbc:db2://192.168.17.12:8801/TES1
org.hibernate.connection.DriverManagerConnectionProvider close
WARNING: problem closing pooled connection
Throwable occured: com.ibm.db2.jcc.b.SqlException: ... java.sql.Connextion.close() requested while a transaction is in progress on the connection.
The transaction remains active, and the connection cannot be closed. ERRORCODE=-4471, SQLSTATE=null
... // obfuscated calls from com.ibm.db2.jcc.b.*
at org.ibm.db2.jcc.b.jb.close(jb.java:1089)
at org.hibernate.connection.DriverManagerConnectionProvider.close(DriverManagerConnectionProvider:175)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder:95)
...
at org.hibernate.tool.ant.Hbm2JavaExporterTask.configureExporter(Hbm2JavaExporterTask:43)
This is only a warning and the hbm2java ant task do the Java file generation correctly. However, this warning make think about a problem when generating the entities from the database.
The solution may be to commit/rollback the transaction (if any) before closing the connection pool. This could be done in JDBCBinder.readFromDatabase() or in the DriverManagerConnectionProvider.close() methods.
Workaround:
-----------------
Set the following property in the hibernate properties file used for the ant task:
hibernate.connection.autocommit=true
--
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