Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
restore default autocommit/readonly/catalog when the connection is ch…
Browse files Browse the repository at this point in the history
…ecked in again.
  • Loading branch information
wwadge committed May 31, 2011
1 parent f514c1f commit fb41f07
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bonecp/src/main/java/com/jolbox/bonecp/BoneCP.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -659,6 +659,21 @@ protected void putConnectionBackInPartition(ConnectionHandle connectionHandle) t
connectionHandle.getInternalConnection().rollback(); connectionHandle.getInternalConnection().rollback();
connectionHandle.getInternalConnection().setAutoCommit(true); connectionHandle.getInternalConnection().setAutoCommit(true);
} }

// restore sanity
if (this.defaultAutoCommit != null){
connectionHandle.setAutoCommit(this.defaultAutoCommit);
}
if (this.defaultReadOnly != null){
connectionHandle.setReadOnly(this.defaultReadOnly);
}
if (this.defaultCatalog != null){
connectionHandle.setCatalog(this.defaultCatalog);
}
if (this.defaultTransactionIsolationValue != -1){
connectionHandle.setTransactionIsolation(this.defaultTransactionIsolationValue);
}



if (this.cachedPoolStrategy && connectionHandle.inUseInThreadLocalContext.get()){ if (this.cachedPoolStrategy && connectionHandle.inUseInThreadLocalContext.get()){
// this might fail if we have a thread that takes up more than one thread // this might fail if we have a thread that takes up more than one thread
Expand Down

0 comments on commit fb41f07

Please sign in to comment.