Hello all,
I am doing a response.sendRedirect after I close the connection to my database however the connection is failing to close. Here is the code ...
int rowsAffected=sql_stmt.executeUpdate (myQuery);
sql_stmt.close();
myConn.close();
if (rowsAffected==1)
{
response.sendRedirect (response.encodeURL("ProjectHighlights.jsp?projectid=" + projectid + "&empid=" + empid ));
}
Once I call this update query multiple time's, tomcat crashes. I think it is because the redirect is occurring before the database connection has a chance to close and then it causes a memory leak on the server. Does anyone know how I can redirect with closing the connections? Thank you.
-Yogesh
I am doing a response.sendRedirect after I close the connection to my database however the connection is failing to close. Here is the code ...
int rowsAffected=sql_stmt.executeUpdate (myQuery);
sql_stmt.close();
myConn.close();
if (rowsAffected==1)
{
response.sendRedirect (response.encodeURL("ProjectHighlights.jsp?projectid=" + projectid + "&empid=" + empid ));
}
Once I call this update query multiple time's, tomcat crashes. I think it is because the redirect is occurring before the database connection has a chance to close and then it causes a memory leak on the server. Does anyone know how I can redirect with closing the connections? Thank you.
-Yogesh