• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web app without session creation

 
Chetan Sahasrabudhe
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can see that there are ways of putting session existing == live of web app

DD says session-timeout = <=0
api saya setSessionMaxInvactiveTime = < 0

I have a need in my application where I need to generate dynamic resonse but dont want to have burden on session object creation.

my code is not even using session to generate the output the call to servlet is purly stateless and need not have any conversational state after the response is flushed.

The need is so that I am expecting around 10k requests / sec.

creation of session object and later lifecycle management time spent by CPU for that object is clearly a overload on my application.

Is there a way that I can stop session object creation.

I dont want to set session-timeout as 1 as it will surely get my app go on toss.

also want to clarify, if within application no code calls getSession method at all then will tomcat create the session ?
 
Saurabh Chaubey
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chetan,

In addition to not calling getSession() method on a HttpSession object you also need to set the session attribute in the page directive of all your JSP's to false as it is true by default.

e.g. <%@page session="false" %>

Regards,
Saurabh
 
Chetan Sahasrabudhe
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not using jsp
itz pure http communication between a electronic sensor and server.

anyting like this where i can say no sessions kind of option
 
Saurabh Chaubey
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chetan,

If you are not using JSP's and also not calling getSession method than no session would be created and the communication will be completly Stateless.

Regards,
Saurabh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic