You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Rhoden <ja...@uptecs.com> on 2007/06/07 03:11:56 UTC

Tomcat keepalive mysql connection.

Hi,

Under tomcat 5.5, I would prevent the database connections from timing 
out by having a Cron job that accesses the website every 10 minute. 
(Because I couldn't work out a better way). This no longer works under 
tomcat 6. Are there any better ways than I am not aware of.? I don't 
think increasing the timeout length in Mysql is a much better solution.

Best Regards,
Jacob

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat keepalive mysql connection.

Posted by Rashmi Rubdi <ra...@gmail.com>.
On 6/6/07, Jacob Rhoden <ja...@uptecs.com> wrote:
> Hi,
>
> Under tomcat 5.5, I would prevent the database connections from timing
> out by having a Cron job that accesses the website every 10 minute.
> (Because I couldn't work out a better way).

How are you connecting to the database? If you are not using
connection pooling, then you're missing out on performance also, it is
highly configurable
http://jakarta.apache.org/commons/dbcp/configuration.html

If you get an exception, you could try re-connecting in the catch
statement of that exception.

>This no longer works under
> tomcat 6. Are there any better ways than I am not aware of.? I don't
> think increasing the timeout length in Mysql is a much better solution.
>
> Best Regards,
> Jacob
>

Rashmi

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org