commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brad Johnson" <>
Subject [dbcp] PoolableConnectionFactory validation and synchronized methods
Date Fri, 21 Nov 2003 20:07:57 GMT
Hello Dirk,

Well, we are trying to get as much concurrency out of our application as we can (uPortal running
on Tomcat).  Seems that allowing concurrent connections to the database should help performance,
and might allow your code to perform well enough that it exposes a bottleneck in the database.
Then the problem is really with the database. So, I really don't see any drawback of removing
synchronized from the code on these methods. Am I missing something here?

Brad Johnson
Texas Tech University

From: Dirk Verbeeck
Subject: Re: JDBC AbandonedObjectPool and PoolableConnectionFactory 
Date: Sun, 28 Sep 2003 11:24:40 -0700

You can remove the synchronization of the validateObject method in PoolableConnectionFactory
but be carefull. If the query is slow because the database is overloaded then allowing more
validationQueries will increase the problem.

For the next release I'm thinking about monitoring SQLExceptions thrown by the connection
and invalidating the connection before it is returned to the pool.

This will cover "broken" connections. Combined with a "testOnBorrowOldConnection" it can replace
the current "testOnBorrow".


Protect yourself from spam, 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message