HHH-2604 : Isolator.JdbcDelegate connection releasing
git-svn-id: https://svn.jboss.org/repos/hibernate/core/branches/Branch_3_2@14999 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
1d89a18d2d
commit
5e1a485f4e
|
@ -215,6 +215,7 @@ public class Isolater {
|
|||
}
|
||||
}
|
||||
finally {
|
||||
if ( connection != null ) {
|
||||
if ( transacted && wasAutoCommit ) {
|
||||
try {
|
||||
connection.setAutoCommit( true );
|
||||
|
@ -228,3 +229,4 @@ public class Isolater {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -590,12 +590,14 @@ public abstract class AbstractBatcher implements Batcher {
|
|||
}
|
||||
|
||||
public void closeConnection(Connection conn) throws HibernateException {
|
||||
if ( conn == null ) {
|
||||
log.debug( "found null connection on AbstractBatcher#closeConnection" );
|
||||
// EARLY EXIT!!!!
|
||||
return;
|
||||
}
|
||||
|
||||
if ( log.isDebugEnabled() ) {
|
||||
log.debug(
|
||||
"closing JDBC connection" +
|
||||
preparedStatementCountsToString() +
|
||||
resultSetCountsToString()
|
||||
);
|
||||
log.debug( "closing JDBC connection" + preparedStatementCountsToString() + resultSetCountsToString() );
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -605,11 +607,7 @@ public abstract class AbstractBatcher implements Batcher {
|
|||
factory.getConnectionProvider().closeConnection( conn );
|
||||
}
|
||||
catch ( SQLException sqle ) {
|
||||
throw JDBCExceptionHelper.convert(
|
||||
factory.getSQLExceptionConverter(),
|
||||
sqle,
|
||||
"Cannot close connection"
|
||||
);
|
||||
throw JDBCExceptionHelper.convert( factory.getSQLExceptionConverter(), sqle, "Cannot close connection" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue