If the user leaves your site, and before the session times out he/she comes back, the session object (your worker bean) will still be there. So yes, the worker bean will be waiting for the session to expire. > -----Original Message----- > From: Lenin Lopez [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 13, 2001 4:07 PM > To: [EMAIL PROTECTED] > Subject: Re: How to get rid of objects ( beans) when the user abandons > the sit e > > > Thanks guys, > let me see if I understand correctly, > That means if I create objects in a servlet and put them in a > session using > the session.setAttribute, and if I use those objects in a > jsp file. what > you are saying is that I should not worry about unbinding the > objects from > the session??? > In other words I do not need to use the session.invallidate() > to unbind the > objects?? > Let me give you a scenario of my problem > > let say my JSP uses a worker bean (whose reference is store > in a session ) > to display a list of available accounts from my DB, now that > same page give > the user the option to delete one of the available accounts > from the list, ( > at this moment I still have a reference to my worker bean in > a session ) > The user can continue with the deletion of one of the > accounts on the list > or the user can JUST LEAVE the site, if the user decides to > do so, at this > point, WHAT happens to my worker bean ( in the session ) > remember I did not invalidated it because I was going to use > it in a future > JSP ( assuming that the user was goint to continue with the process of > deletion) > Since the user as I said JUST LEAVES the site. How do I > reclaim the memory > in use by the session. > Do I just wait until it expires??? > What if I have more than one object in the same situation?? > Thanks a lot for your input > > > -----Original Message----- > From: A mailing list about Java Server Pages specification > and reference > [mailto:[EMAIL PROTECTED]]On Behalf Of Chandra Patni > Sent: Wednesday, June 13, 2001 1:12 PM > To: [EMAIL PROTECTED] > Subject: Re: How to get rid of objects ( beans) when the user abandons > the sit e > > > You can't get rid of objects as such because that's what GC > is doing for > you. All the object u are creating in your JSP will follow > the same GC rule > as other object created in any method. For beans you can > specify the scope > mechanism to control how long you want to keep the reference handle. > I will NEVER suggest you finalize() method to do some 'smart > things'. By > overriding finalize(), you are effectively increasing the > life of the object > as GC now has to deal with this object at least twice. > Regards, > Chandra Patni > Oracle Corp > > -----Original Message----- > From: A mailing list about Java Server Pages specification > and reference > [mailto:[EMAIL PROTECTED]]On Behalf Of Lenin Lopez > Sent: Wednesday, June 13, 2001 12:51 PM > To: [EMAIL PROTECTED] > Subject: How to get rid of objects ( beans) when the user abandons the > sit e > > > HI all, > My question is how to get rid of object ( to avoid memory > leaks) when the > user 'just' abandons the site > is there any way I can detect when the user leaves the page > so I can triger > some kind of event to get rid of my objects? > > Please > Help > Thank you all > > ============================================================== > ============= > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff > JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST > DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.html > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets > > ============================================================== > ============= > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff > JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST > DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.html > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets > > ============================================================== > ============= > To unsubscribe: mailto [EMAIL PROTECTED] with body: > "signoff JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set > JSP-INTEREST DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.html > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets > =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
