This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSP and the fly likes Can't close connection object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Can Watch "Can New topic
Author

Can't close connection object

s choukse
Greenhorn

Joined: Dec 12, 2001
Posts: 27
Hello forum
I am havig a problem regarding closing the connection object.
I am dealing with jsp's and working on J2ee server so i dont have the option for Connection pool. I have made a bean which takes care ffor the connection . The problem arises when user directly kills the browser window at tha time i am not left with any option to close connection. And i run out of connections supported by the server if the number of user increase.
Please help me regarding this.

------------------
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
You could have your bean implement the HttpSessionBindingListener interface and add it to the session. Then when the session times out your bean will be notified and you can close the connection.
Doesn't your J2EE implementation provide a connection pool function?
Bill

------------------
author of:
s choukse
Greenhorn

Joined: Dec 12, 2001
Posts: 27
No it does not Bill.
saurabh
 
GeeCON Prague 2014
 
subject: Can't close connection object