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 |
From: Bulto (JIRA) <no...@at...> - 2006-06-06 16:15:29
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1669?page=comments#action_23274 ] Bulto commented on HHH-1669: ---------------------------- Hello, It's a serious bug. ligne 181 : [code] finally { if ( wasAutoCommit ) { try { connection.setAutoCommit( true ); } catch( Throwable ignore ) { log.trace( "was unable to reset connection back to auto-commit" ); } session.getBatcher().closeConnection( connection ); } } [/code] The connection is closed only if it was AutoCommit. Hibernate must always close the connection. The correct code : [code] finally { if ( wasAutoCommit ) { try { connection.setAutoCommit( true ); } catch( Throwable ignore ) { log.trace( "was unable to reset connection back to auto-commit" ); } } session.getBatcher().closeConnection( connection ); } [/code] > 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 |
From: Steve E. (JIRA) <no...@at...> - 2006-06-06 17:30:36
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1669?page=all ] Steve Ebersole reopened HHH-1669: --------------------------------- > 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 |
From: Steve E. (JIRA) <no...@at...> - 2006-06-06 17:30:36
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1669?page=all ] Steve Ebersole closed HHH-1669: ------------------------------- Fix Version: (was: 3.2.0) Resolution: Duplicate > 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 |
From: Steve E. (JIRA) <no...@at...> - 2006-06-06 17:30:37
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1669?page=all ] Steve Ebersole closed HHH-1669: ------------------------------- Fix Version: 3.2.0 Resolution: Duplicate > 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 |