Re: When should I update the database?

Chris Pratt <[email protected]> Fri, 21 Oct 2005 14:33:00 -0700
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
------=_Part_2414_16975733.1129930380398
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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

On 10/21/05, Ming Li <[email protected]> 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 [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
>

___________________________________________________________________________
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


------=_Part_2414_16975733.1129930380398
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Put a reference to the data that needs to be saved to the database in
the Object that implements HttpSessionBindingListener.&nbsp; Then you
will have access to it when the valueUnbound() method is called.<br>
&nbsp; (*Chris*)<br><br><div><span class=3D"gmail_quote">On 10/21/05, <b cl=
ass=3D"gmail_sendername">Ming Li</b> &lt;<a href=3D"mailto:email2mingli@yah=
oo.com">[email protected]</a>&gt; wrote:</span><blockquote class=3D"gm=
ail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt =
0pt 0pt 0.8ex; padding-left: 1ex;">
I have some data kept in the session object that can be changed very<br>fre=
quently by users during each session, so it's not efficient to update<br>da=
tabase whenever a user makes a change. I want to update database just<br>
before the session times out. I thought I could do database update in<br>va=
lueUnbound of HttpSessionBindingListener. But at that moment, the data is<b=
r>already gone. Could anybody suggest any solution?<br><br>Thanks.<br><br>
___________________________________________________________________________=
<br>To unsubscribe, send email to <a href=3D"mailto:[email protected]">=
[email protected]</a> and include in the body<br>of the message &quot;s=
ignoff SERVLET-INTEREST&quot;.
<br><br>Archives: <a href=3D"http://archives.java.sun.com/archives/servlet-=
interest.html">http://archives.java.sun.com/archives/servlet-interest.html<=
/a><br>Resources: <a href=3D"http://java.sun.com/products/servlet/external-=
resources.html">
http://java.sun.com/products/servlet/external-resources.html</a><br>LISTSER=
V Help: <a href=3D"http://www.lsoft.com/manuals/user/user.html">http://www.=
lsoft.com/manuals/user/user.html</a><br></blockquote></div><br>
___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".
<p>
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
<p>

------=_Part_2414_16975733.1129930380398--