commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: [dbcp] prepared statement caching when connections are closed but connection pool still has connection
Date Fri, 27 Jul 2012 11:53:49 GMT
On 25/07/2012 15:01, Amish Shah wrote:
> Does the DBCP support prepared statement caching in the following condition
> 1) connection is opened from connection pool
> 2) Prepared statement are used
> 3) Connection is closed but returned to connection pool
> If we reuse the connection from the connection pool is there a way the
> prepared statement from step #2,
> could be used without parsing again.
> What I am seeing is that prepared statement are being parsed again?
> We are using version of DBCP 1.2.1
> Any help/response would be good.

I took a quick look at the source code. The DBCP code is a bit of a maze
and I'd need to test it to be sure but I think the statement cache is
retained while the connection is checked out but cleared when the
connection is returned. I suspect you'll be able to check this faster
than I can.


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

View raw message