Pinghua Young wrote:

> We are using ServletExec 2.1 and it does support sessions across server
> restart.  The problem I have is, I don't have any way to make my hashtable
> persistent across server restart.  All data in our sessions are
> Serializable.
>
> Without an API method to somehow get a list of active sessions, I can't
> seem to be to do what I want, which is very desirable IMHO.
>

Having an API method to get the list of active sessions will not help you achieve your 
overall goal,
without additional support from the servlet engine itself.  Consider the hypothetical 
case where you had
such a call, and walk though the events that are occurring:

* The server is told to restart itself.

* You find out about this in some fashion (presumably
  in the destroy() method of some particular servlet).

* You access the list of valid sessions and write out
  their contents somewhere, using serialization.

* The restart is completed.  At this point, the servlet
  engine's internal collection of active sessions has
  been erased.

* Your servlet's init() method is called, and you get
  ready to load back in the session data from the
  previously active sessions.

* But now what do you do?  There's no mechanism
  to create a session that works inside the init()
 method, or to create more than a session for the
  current request in doGet() or doPost().

Bottom line:  if you want sessions to survive server restarts, your servlet engine has 
to support this
functionality itself.  Only the servlet  engine has the access to its own internal 
data structures
necessary to accomplish this.  If the servlet engine does support it, there is no need 
for you to access
a list of active sessions because it's all taken care of for you transparently.

>
> --Pinghua
>

Craig

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to