mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-27 14:30:16 +00:00
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 @@ else if ( t instanceof SQLException ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
if ( connection != null ) {
|
||||||
if ( transacted && wasAutoCommit ) {
|
if ( transacted && wasAutoCommit ) {
|
||||||
try {
|
try {
|
||||||
connection.setAutoCommit( true );
|
connection.setAutoCommit( true );
|
||||||
@ -228,3 +229,4 @@ else if ( t instanceof SQLException ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -590,12 +590,14 @@ public Connection openConnection() throws HibernateException {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void closeConnection(Connection conn) throws HibernateException {
|
public void closeConnection(Connection conn) throws HibernateException {
|
||||||
|
if ( conn == null ) {
|
||||||
|
log.debug( "found null connection on AbstractBatcher#closeConnection" );
|
||||||
|
// EARLY EXIT!!!!
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( log.isDebugEnabled() ) {
|
if ( log.isDebugEnabled() ) {
|
||||||
log.debug(
|
log.debug( "closing JDBC connection" + preparedStatementCountsToString() + resultSetCountsToString() );
|
||||||
"closing JDBC connection" +
|
|
||||||
preparedStatementCountsToString() +
|
|
||||||
resultSetCountsToString()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -605,11 +607,7 @@ public void closeConnection(Connection conn) throws HibernateException {
|
|||||||
factory.getConnectionProvider().closeConnection( conn );
|
factory.getConnectionProvider().closeConnection( conn );
|
||||||
}
|
}
|
||||||
catch ( SQLException sqle ) {
|
catch ( SQLException sqle ) {
|
||||||
throw JDBCExceptionHelper.convert(
|
throw JDBCExceptionHelper.convert( factory.getSQLExceptionConverter(), sqle, "Cannot close connection" );
|
||||||
factory.getSQLExceptionConverter(),
|
|
||||||
sqle,
|
|
||||||
"Cannot close connection"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user