commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sitowitz, Paul" <PSitow...@verisign.com>
Subject RE: DBCP: validationQuery Problems
Date Wed, 16 Nov 2005 17:04:45 GMT
Tim,

In addition to setting the validation query, you will ALSO need to
configure the pool to perform "validate on return". You can configure
validation to occur upon borrowing connections, returning connections,
and during the time when connections sit idle in the pool.

Check out the online JavaDocs for GenericObjectPool and
GenericKeyedObjectPool for more of the details and specifics:

http://jakarta.apache.org/commons/pool/apidocs/

Paul

-----Original Message-----
From: Tim Patton [mailto:tpatton@dealcatcher.com] 
Sent: Wednesday, November 16, 2005 11:55 AM
To: commons-user@jakarta.apache.org
Subject: DBCP: validationQuery Problems

I'm using DBCP with the JTDS SQL driver.  I seem to be having a problem
where the validation query is not always running (I assume).  Basically
I
have a pool of connections that have sat idle for hours; the server has
most
likely shut them down by now.  When I execute an update I get
"java.sql.SQLException: I/O Error: Connection reset by peer: socket
write
error".  However, it is my understanding that before returning a
connection,
the pool should run the validation query and make sure it still works.
This
does not seem to be the case.  Is there any way to guarantee this runs?
I
have set the validation query to a working, non null value, and I always
get
a new connection when executing any SQL, as well as always closing the
connection when I am done.

 

Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message