| I think the bug is in JdbcTransaction.releaseManagedConnection if for whatever reason the connection get's closed, the setAutoCommit will throw and exception and the managedConnection isn't reset. Even retrying to start the transaction will fail because it is bind the the current thread. Solution should be that managedConnection=null is moved after the catch so the post condition is always that managedConnection = null private void releaseManagedConnection() { try { if ( wasInitiallyAutoCommit ) { LOG.debug( "re-enabling autocommit" ); managedConnection.setAutoCommit( true ); } managedConnection = null; } catch ( Exception e ) { LOG.debug( "Could not toggle autocommit", e ); } } |