Why are you maintaining open connections while waiting for the user?  Use a
connection pool, connect only whem needed and close when done.

-----Original Message-----
From: George Klimes [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 22, 2000 11:32 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: HttpSessionBindingEvent


Hi everyone, quick question.

I have an object that has two methods, which do the following:
1)  create a connection
2)  close the connection (clean up after connection
    is not needed.
Let's call it connection object.

  This connection object is initialized from a servlet and as soon as
the client has a valid HttpSession object.
Under ideal circumstances, the connection remains opened as long as
the a session is valid. When the client closes the browser or the
session
times out, the connection object calls the method that closes the
connection
and cleans up.

   Here's the problem.
If the client opens another browser window, or the layout has
frame set, the new browser window initializes  the connection object.
This
means the the first browser window reference points to the connection
object initialized by the second window. The implication is,
the first window cannot close the connection (when the session
is invalid), since it doesn't reference the connection object
it originally initiated.  How could I avoid this  ?

HttpSessionBindingEvent and HttpSessionBindingListener might do
the magic, however, I wouldn't mind second opinion from the masses.

         Thank you for your time.
                                        GK.
BTW: I am running JServ1.1 (JSDK2.0)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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

Reply via email to