Maybe some others have not yet changed to turbine 2.2,
so i'll port my solution.
I found that after several hours always ConnectionWaitTimeoutExceptions
were thrown, even though no users were using the system.
The ConnectionPool was supposed to be empty and the totalConnections were
found to be maxConnections (meaning all Connections were in use which was
not the case).
Looking through the code and the logs, i found the message:
WARN -- A DBConnection was finalized, without being returned to the ConnectionPool it
belonged to
The DBConnection has a Method named finalize() which was called in fact.
The problem in this method is, that the connection is being closed and a
new Connection is being created WITHOUT decrementing the pool.
CODE:
connection.close();
// Releasing a new DBConnection object will prevent leaks
// from the pool
pool.releaseConnection(pool.getNewConnection());
My solution - note that i catch exceptions while closing the physical connection (u
never know):
try
{
connection.close();
}
catch (Exception e)
{
Log.debug("while finalizing the DBConnection there was an error" + e);
}
// decrement the created connections
pool.decrementConnections();
// Releasing a new DBConnection object will prevent leaks
// from the pool
pool.releaseConnection(pool.getNewConnection());
Hope this helps someone else too ;P
Christine Keim