Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Servlet Interest »

Re: When should I update the database?

Chris Pratt

2005-10-21

Replies:

Put a reference to the data that needs to be saved to the database in the Object that implements HttpSessionBindingListener.  Then you will have access to it when the valueUnbound() method is called.
  (*Chris*)

On 10/21/05, Ming Li <email2mingli@yahoo.com> wrote:
I have some data kept in the session object that can be changed very
frequently by users during each session, so it's not efficient to update
database whenever a user makes a change. I want to update database just
before the session times out. I thought I could do database update in
valueUnbound of HttpSessionBindingListener. But at that moment, the data is
already gone. Could anybody suggest any solution?

Thanks.

___________________________________________________________________________
To unsubscribe, send email to listserv@java.sun.com 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

___________________________________________________________________________ To unsubscribe, send email to listserv@java.sun.com 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

©2008 junlu.com - Jax Systems, LLC, U.S.A.