From: julio r. (JIRA) <no...@at...> - 2006-04-14 11:04:48
|
TransactionHelper leaves JDBC connections unclosed, when the connection is set to autocommit false -------------------------------------------------------------------------------------------------- Key: HHH-1669 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1669 Project: Hibernate3 Type: Bug Components: core Versions: 3.2.0 cr1 Environment: Hibernate 3.2.0 CR1 Reporter: julio rincon The Isolater.JdbcDelegate class's delegateWork(...) method leaves the JDBC Connection open causing a lekage. Specifically, the connection is left open only when the Connection was set to autocommit false. The escenario in which the problem is experienced is when a TransactionHelper subclass is implemented for instance to generate custom identifiers, the TransactionHelper provides the doWorkInNewTransaction method to ensure that the ID generation is done in a separate transaction and always commited. The mentioned method uses the Isolater class for this purpose. This is the patch: Index: src/org/hibernate/engine/transaction/Isolater.java =================================================================== --- src/org/hibernate/engine/transaction/Isolater.java (revision 9747) +++ src/org/hibernate/engine/transaction/Isolater.java (working copy) @@ -185,9 +185,9 @@ } catch( Throwable ignore ) { log.trace( "was unable to reset connection back to auto-commit" ); - } - session.getBatcher().closeConnection( connection ); + } } + session.getBatcher().closeConnection( connection ); } } } Cheers Julio. -- 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 |