You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tim Freeman <ti...@fungible.com> on 2004/06/18 23:57:01 UTC
How to recover from a database server restart when using connection pools?
I am using database connection pooling and I would like my Tomcat
server to be able to cope gracefully with the database server being
stopped and restarting. This creates a confusing situation because
the connections in the pool all become invalid in that case.
Is there a standard way to deal with this? Googling around didn't
turn up anything, but it's surely a common situation. I must have
searched for the wrong keywords.
--
Tim Freeman tim@fungible.com
GPG public key fingerprint ECDF 46F8 3B80 BB9E 575D 7180 76DF FE00 34B1 5C78
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: How to recover from a database server restart when using connection
pools?
Posted by Alex <al...@squigly.net>.
Use a validationQuery when creating your connection pools. This can be
defined where you define your resource.
<parameter>
<name>validationQuery</name>
<value>select 1</value>
</parameter>
On Fri, 18 Jun 2004, Tim Freeman wrote:
> Date: Fri, 18 Jun 2004 14:57:01 -0700
> From: Tim Freeman <ti...@fungible.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: How to recover from a database server restart when using
> connection pools?
>
>
> I am using database connection pooling and I would like my Tomcat
> server to be able to cope gracefully with the database server being
> stopped and restarting. This creates a confusing situation because
> the connections in the pool all become invalid in that case.
>
> Is there a standard way to deal with this? Googling around didn't
> turn up anything, but it's surely a common situation. I must have
> searched for the wrong keywords.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org