• 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

persistent servlet

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody

I know servlets are persistent.
It retains some data in its memory,so it avoids frequent disk access against the database.
Which is the memory of servlet? ie. how servlets are persistent?
Because of using session variables?

PLS FRIENDS CLARIFY TO ME

THX
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure I understand your question correctly, but servlets are not persistent, they should be 'effectively stateless', that is any state they require internally should be treated as a constant and not be able to change, and idealy this state would be set on the ServletContext and not the Servlet itself.
 
vishvar hariraman
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes,ofcourse.
Using ServletContext,servlet can retain a constant value and share it with other servlets also.
then we can say it as persistent
but u say it s not.what s the reason for that?
which thing we shud say as persistent? Connecting to database only?
pls clarify.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I said, the servlet does not retain any state itself, it allows any state it requires to be retained elsewhere, outside the servlet itself. Likewise, the servlet should not (or in this case must not) maintain state such as Database connections. In the case of DB connections it is dangerous and wasteful, and Connection Brokers do the job much beter.

Dave
 
vishvar hariraman
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thx david
i got
------Vishnuvardhan.H
 
Everyone is a villain in someone else's story. Especially this devious tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic