You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// this should never happen, should we throw an exception or log at warn/error?
if (usageCount > 0) {
log.warn("close connection with usage count > 0, " + this);
}
However, should JdbcPooledConnection.getConnectionHandle() throw a SQLException because (e.g.) testConnection() has failed, then usageCount will still have been incremented when XAPool.getConnectionHandle() tries to close the invalid connection.
The patch is trivial:
// Increment the usage count
usageCount++
try {
// etc
} catch (SQLException e) {
// This connection must be invalid, so revert the usage counter.
// Note: Closing a handle with usageCount > 0 "should never happen".
--usageCount;
throw e;
}
Cheers,
Chris
The text was updated successfully, but these errors were encountered:
I've committed this change into my BTM tree on github, but cannot see how to create a new pull request that doesn't also include my existing and outstanding pull request #15.
Hi Vlad,
Thanks, I think that a "feature branch" is well worth using for future pull requests. However, seeing as I was actively asked to create #15, I don't think that it's unreasonable to hope that it be merged first.
JdbcPooledConnection.close() says:
However, should JdbcPooledConnection.getConnectionHandle() throw a SQLException because (e.g.) testConnection() has failed, then usageCount will still have been incremented when XAPool.getConnectionHandle() tries to close the invalid connection.
The patch is trivial:
Cheers,
Chris
The text was updated successfully, but these errors were encountered: