#14 c3p0 pool hangs in failure test cases


Operating System of the Server: linux ES 3.0
Database running on the Server: Timesten 5.0.36

Operating System of the Client : linux ES 3.0
Java Version: 1.4.2_06

C3P0 version : 0.8.4

The client creates a pool and the creation is
successfull, and the client is able to get a JDBC
Connection from the pool use it and release it to the

Scenario 1.) Power outage happened on the Server -
that means there is no graceful shutdown of the Server

Issue: The pool which was created in the client is in
hung state and when we try to destroy the same it
doesnt get destroyed properly, and if we ignore the
destroy failure and try to create a new pool( the Powere
and Server is up by this time) even that also fails.

Recovery: The only way to recover is to stop the Client
and restart the Client again

Note: The client has multiple threads and is alive so that
we can test the above scenario

Scenario 2.)Ip Connectivity plug which is connected to
the Server is suddenly removed

Issue: Same as above

Recovery: Same as above

Note: Same as above

Scenario 3.)
Lets assume the Database Server is running fine and if
there is no DataStore on the Database Server and we
try to create a Connection Pool using non-existent
Datastore - it is successfull.

Issue: But when the Connection is retrieved from the
pool and we try to make a query or DB transaction that
thread gets hung

Recovery: Same as above

Notes: Same as above

Any help or pointers to miitgate or solve the above
issues will greatly help

Suggestion: If the C3p0 API can expose a Timer to
JDBC Connection objects and if the connection doesnt
respond within the timer set value and if it can come out
and destroy the connection object rather than being
hung for-ever that will solve all the above failure cases

Apppreciate the help in advance

Thanks & Regards,
Shiva Cheedella


  • Steve Waldman

    Steve Waldman - 2005-08-05
    • status: open --> closed
  • Steve Waldman

    Steve Waldman - 2005-08-05

    Logged In: YES

    I think we've resolved this by e-mail. It's not a bug -- user was working
    with an older version of c3p0, and without connection testing configured.

    However, the user does call attention to an interesting issue -- the user's
    database hangs rather than failing with exception when an attempt is
    made to use a stale or invalid exception. c3p0's connection testing
    regime is not really set up for that -- c3p0 expects its tests to fail with
    exception or to succeed, not to hang indefinitely. It may be worth
    allowing users to set a maxTestDuration parameter so that tests fail if
    they hang after a certain period of time.


Log in to post a comment.