• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

web app without session creation

 
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 ?
 
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
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic