This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

persistent servlet

 
vishvar hariraman
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • 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
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
thx david
i got
------Vishnuvardhan.H
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic