Rajesh,
Putting the connection object into the user's session limits the
scaleability of your app and introduces the problem you describe. It is
better to use a connection pool to utilize the database connections more
efficiently. This allows the connections to be used only when the servlets
are being invoked and otherwise frees them up to handle a larger number of
users.
Regards,
Richard
At 05:48 PM 8/21/01 +0530, you wrote:
>Hi All,
>
>I want to know if anybody has a complete solution to the problem described
>below:
>
>In our application (java- servlet based), when the user logs into
>the website, user specific connection object is created and stored into
>session and throughout the user session, on every page that the user
>visits, <?xml:namespace prefix = o ns =
>"urn:schemas-microsoft-com:office:office" />
>
>the connection object is retrieved from the session and used to fetch the
>records from DB.
>
>Now when the user explicitly logs out by clicking on logout button, then a
>servlet(logoffServlet.java) is invoked which retrieves connection
>from session, closes it and then invalidates the session.
>
>What we want is:
>
>if user closes the browser
>
> Or
>
>goes to some other website, either by explicitly typing the URL, or
>clicking on browser back
>
>and forward buttons, then we want to invalidate the session and close the
>connection.
>
>So how do I trap the browser close event and how do I trap whether the user
>
>has left the website or not.
>
> Regards
>Rajesh Nair
___________________________________________________________________________
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