|
I
think you cannot know when the client browser closes.
there are 2 options
- use connection pooling and return the connection to the pool
after each request. I think that's the prefered method, but if you really need
one dedicated connection per user, it's not really possible.
- Wrap your database connection in another object that
implements the HttpSessionListener interface and put this object in your
session. when the user logs out or when the session times out (15 or 30 minutes
inactivity), an event is triggered where you can close the
connection.
I
would recommend the second option anyway in case you forget to close a
connection when you use the first option.
Geert
'Darling' Van Damme
|
- Disconnect from a db when client browser closes 林志峰
- Re: Disconnect from a db when client browser... Geert Van Damme
- Re: Disconnect from a db when client browser... Nanduri Amarnath
