Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

Tomcat (thread awakening?)

Thread view: 
R. Vince - 06 May 2007 13:03 GMT
I am running a simple test servlet in Tomcat 5.0.28. Essentially, I send the
servlet an SQL query, the servlet uses a connection pool to connect to a
MySQL DB.

Everything works fine. However, if, say, roughly, say, 12 or more hours
elapse (i.e. "overnight") and I make a a call to the servlet, where
typically it would return the value of a row from a resultset to me, it
returns nothing. If I subsequently refresh the browser, everything works
back to normal.

For a long time, I thought perhaps this was merely because MySQL had some
parameter within it that made it go to sleep -- but that is not the case
here. This is somethign with Tomcat, and the browser refresh solution is the
clue to what might be wrong. Can anyone point me in the right direction
here? Thanks.
Lew - 06 May 2007 13:23 GMT
> I am running a simple test servlet in Tomcat 5.0.28. Essentially, I send the
> servlet an SQL query, the servlet uses a connection pool to connect to a
[quoted text clipped - 11 lines]
> clue to what might be wrong. Can anyone point me in the right direction
> here? Thanks.

Either the session or the connection timed out.  The refresh either
established a new session or a new connection.

Signature

Lew

Philipp Taprogge - 06 May 2007 13:27 GMT
Hi!

> Can anyone point me in the right direction
> here? Thanks.

Probably, the connections in the pool time out over time. Make sure
you configure your DataSource with ?autoreconnect=true...

HTH,
    Phil


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.