MySQL shuts down the connections after 8 hours. Ran into this myself.
Yes, Tomcat has pooling built in.
Yes, it handles all aspects of the pool.
Try this link to start with:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html
It is directed more to the database pooling. There is also lots of entries
in the archives.
Some people have no problem setting it up but there are a few that run into
some configuration issues that seem to baffle them.
Some tips:
Watch the naming that both case and spelling match.
Put the drivers in common/lib
Use the latest drivers.
Make sure you have only one copy of the drivers.
Doug
----- Original Message -----
From: "Scott Purcell" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, August 30, 2005 1:08 PM
Subject: Database Pooling
Hello,
To start off with, I hand rolled a database pooling class to handle database
pooling for a ecommerce site I am writing. The application is web-based so
of course I am using Tomcat 5.5 and all was going well. But in my
implementation, I occasionally get errors when the connection has not been
used for a long period of time. Basically mysql or tomcat may be taking
themselves out of service and I get some java.net errors through Tomcat.
Anyway, I got frustrated and began to look through some on-line docs in
regards to Tomcat and DatabasePooling.
Which leads me to my question:
Is pooling build-in to Tomcat 5.5?
If so, how simple is this to implement (I have read here:
<http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html>
but I an not familiar with JNDI.
And if it does it take care of shutting down the pool when the server gets
reloaded or gets unloaded?
Currently my pooling solution is huge, with threads to monitor if they are
closed, etc. I figure there has to be a better implementation, or solution
for myself in this regards
Could anyone please help out with some sample, or explanation of how this
all fits together.
I have created business objects, so I just need to call the database from
business objects, not directly from tomcat.
Thanks,
Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]