F
finecur
Hi, I hope you guys can help me.
I have a servlet and inside it I have code like this:
public void doGet(HttpSevletRequest request, HttpServletResponse
request)
throws ServletException, IOException {
Connection conn = getConnectionFromPool();
doMyBigWork(); //this line takes long time
closeMyConnection(conn);
}
Since doMyBigWork() takes a long time, sometimes user did not wait
for my servlet return and click other pages. It ended up with
closeMyConnection(conn) never called. And I have more and more
connection lost and eventrually the connection pool got exhausted. How
can I handle this problem?
Thanks,
fm
I have a servlet and inside it I have code like this:
public void doGet(HttpSevletRequest request, HttpServletResponse
request)
throws ServletException, IOException {
Connection conn = getConnectionFromPool();
doMyBigWork(); //this line takes long time
closeMyConnection(conn);
}
Since doMyBigWork() takes a long time, sometimes user did not wait
for my servlet return and click other pages. It ended up with
closeMyConnection(conn) never called. And I have more and more
connection lost and eventrually the connection pool got exhausted. How
can I handle this problem?
Thanks,
fm