Broken connection leaked on database connection issue
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
BoneCP |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
We hit a strange problem in 0.7.2 branch of BoneCP. When a connection breaks (for example, due to underlying database connection issues) our ConnectionHook#
BoneCP#
Do we have to explicitly close the connection in our ConnectionHook implementation?
Hmm .... it may actually be the application that leaks the connection. We use Carbonado persistence layer and here is the relevant code:
try {
throw new FetchException( "Repository is closed");
if (mOpenConnections == null) {
}
if (txn != null) {
// Return the connection used by the current transaction.
}
// Get connection outside lock section since it may block.
Connection con = mDataSource. getConnection( );
con. setAutoCommit( true);
try {
if (mOpenConnections == null) {
}
} finally {
}
return con; n(e);
} catch (Exception e) {
throw toFetchExceptio
}
#setAutoCommit throws and SQLException (we don't test connections on checkout). This does not close the connection.