I think this is fixed already, have you checked the latest version?
ja...@he... wrote:
> Hi all,
>
> I think org.hibernate.engine.transaction.Isolater is not handling connections properly:
>
> The method JdbcDelegate is currently implemented as follows:
>
> public static class JdbcDelegate implements Delegate {
> ...
> public void delegateWork(IsolatedWork work) throws HibernateException {
> Connection connection = null;
> try {
> connection = session.getBatcher().openConnection();
> ...
> }
> ...
> }
> 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 );
> }
> }
> }
> }
>
>
> This means that the connection will only be closed if wasAutoCommit==true but I think it should be closed in any circumstance:
>
>
> public static class JdbcDelegate implements Delegate {
> ...
> public void delegateWork(IsolatedWork work) throws HibernateException {
> Connection connection = null;
> try {
> connection = session.getBatcher().openConnection();
> ...
> }
> ...
> }
> 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 );
> }
> }
> }
>
> What do you think ?
>
>
|