btm
btm copied to clipboard
Closing a connection with "usageCount > 1" is actually possible.
JdbcPooledConnection.close() says:
// 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 an exception because (e.g.) testConnection() has failed, then usageCount will still have been incremented when XAPool.getConnectionHandle() tries to close the invalid connection.