• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

priorities in Servlet 2.3

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a servlet which will take atleast 5 mins to complete the service() method(imagine) due to some complex EIS query. i need to know one thing that if i set my session timeout period to say 1 minute and i enter the servlet what priority i will be getting. that is since i am yet to get the response from the server, my session will be active or since the time taken to cater my request takes more than the session time out interval, so my session will be getting invalidated.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i need to know one thing that if i set my session timeout period to say 1 minute and i enter the servlet what priority i will be getting.


Session timeout has nothing whatsoever to do with Thread priority. Why would you want such a short timeout?
There have been a LARGE number of discussions here about how to handle time consuming queries gracefully in servlets - browse around in the last few weeks of posts.
Bill
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there some way that the results of your long query can be cached locally ?

In that case, you can load the servlet on start-up and the data from the long query can be cached locally so that the subsequent requests read it from the cache and do not take that long.

Also, see the following URL -
http://www.javaranch.com/newsletter/200403/AsynchronousProcessingFromServlets.html
[ June 04, 2004: Message edited by: Siyaa Hoffman ]
 
Sundar Gopal
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for your response. actually the query takes nearly 45 mins to complete and its differs according to the user. will it be possible to cache that all!!! thats why i need to know about the session timeout priorities. kindly help me if u have any suggestion to increase the query performance.
:roll:
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
45 minutes is WAAYYYYY too long for a single request/response cycle and if the result is huge, storing it in the session is not appropriate. You will need to conduct the query in a separate Thread - maybe even a separate process, and provide some key in the session, or maybe in a longer-lived cookie for the user to retrieve the result later.
What format is the result in?
Bill
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yah. Don't mistake the user's browser for a client/server client program. Web browsers are "hit-and-run". The user has no real idea what is happening when they hit Submit and nothing comes back for minutes at a time. For all they know, the server crashed.

I have a project where the backend can take literally hours. Among other things, this was holding the entire Tomcat server for ransom when I ran it in the Tomcat JVM. If some other process went south, we couldn't restart Tomcat without killing the backend engine as a side-effect.

Finally ended up making the engine a separate application altogether and used RMI from Tomcat to invoke it and query for run status.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic