• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat idle after a few initial invocations

 
John McDonald
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I implement a servlet that retrieves data from an Oracle database based the input. The transaction is valid for the first time but is idle after. I watch the background screen and don't see the servlet was actually invoked again. How do I figure it out why? Thanks a bunch.

John
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by John McDonald:
and don't see the servlet was actually invoked again.


What do you mean by "invoked again"? What makes you think it should be invoked again? Are you hitting it a second time? Please take a little more time to describe what is happening, and why it is different from what you expect.
 
John McDonald
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hit the button for the first time to perform a quey and got the result. I did the second time, third time and did not see the page moved. Thanks and sorry for insufficient description.

John
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to put some logging in your servlet.
System.out.println("..."); will do if you don't have a real logger available.

Also, you might want to install the LiveHTTPHeaders plugin to Firefox.
With it, you can see the request and response headers created by the browser and server. This would help you diagnose a caching problem.
 
Manesh Kumar
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by John McDonald:
I hit the button for the first time to perform a quey and got the result. I did the second time, third time and did not see the page moved. Thanks and sorry for insufficient description.

John


I think you need to set the response headers like

Cache-Control: max-age=0, must-revalidate
Pragma : no-cache
Expires : Mon, 29 Jun 1998 02:28:12 GMT

These headers forces browser not to cache the content and sent request again.

You may also need to check the Temporary Internet Files settings in IE. You need to set Every Visit to page.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!