tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Schumacher <>
Subject Re: recovering connections on jdbc connection pool
Date Sun, 08 May 2011 15:19:16 GMT
Am Sonntag, den 08.05.2011, 11:42 -0300 schrieb alexis:
> Hello all, is there any way to recover lost connectios on a pool?
> Here's the issue, for an application, using postgresql jdbc (same happens with mysql
as i tried), having query errors syntax or duplicated keys, actually no big deal, it throws
an sqlexception upon que sql error, as this call executes ~150 queries to insert, on each
query i lost the connection, so suddenly i have all my connections lost and my app useless.
> How can i do from the catch clause of the SQLException to ask the pool to reconnect?
Because today we are in debug stage but soon to be production and when this happens (we've
corrected a lot of queries and situations but for sure some new one will arise) we need to
restart the webapp.
SQL Connections should not get lost when used properly. You have to
close the connections and every resources you got out of that connection
in case of a program error. Look for "jdbc try finally".

As a helper to find connections, you did not close properly you can
configure your jdbc pool to show your abandoned connections. Another
safety net are the validation queries. For further information look at

> thanks in advance. 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message