I'm trying to run the Turbine connection pool in stand alone mode. I
appear to be having the same trouble that is mentioned in this message:
http://www.mail-archive.com/[email protected]/msg04946.html.
(And yes I am setting the properties file name.)
The connection pool is just "stopping" after I max out the number of
connections specified in the TurbineResources.properties file.
org.apache.turbine.util.db.pool.ConnectionPool appears to get caught in
an endless wait state which it is never notified to leave. It's a
little hard to follow, but the pool appears to be creating the maximum
number of connections, doling them out, then getting hung by the call to
Object.wait() ( which waits indefinitely for a call to Object.notify()
or Object.notifyAll() ). If I could get a second set of eyes on this, I
would be infinitely grateful. Also, if someone could verify that the
everything works in "standard" mode, that would be helpful as well
(since I've been mucking around with connection pool). Thanks guys.
private synchronized DBConnection getPooledConnection(String driver,
String url,
String
username,
String
password)
throws Exception
{
while (true)
{
if (!pool.empty())
{
DBConnection con = (DBConnection) pool.pop();
// It's really not safe to assume this connection is
// valid even though it's checked before being pooled.
if (isValid(con))
{
connectionAttemptsCounter = 0;
return con;
}
else
{
con.close();
totalConnections--;
connectionAttemptsCounter = 0;
// Need to create a new connection here, if the
// pool is empty. Otherwise we can get stuck
// waiting for a connection to be returned and no
// one has any checked out.
if (pool.empty())
{
return getNewConnection(driver, url, username,
password);
}
// Don't return to the wait state here - just go
// to the next iteration and try again.
continue;
}
}
else
{
connectionAttemptsCounter++;
}
// wait(1);
wait();
}
}
--
Daniel Rall <[EMAIL PROTECTED]>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]