• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Unable to find cause of the Connection leak?

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the error.

Error in CrsHierarchyHandler.javajava.sql.SQLException: Connection has already been closed.
java.sql.SQLException: Connection has already been closed.
at weblogic.jdbc.pool.Connection.checkIfClosed(Connection.java:62)
at weblogic.jdbc.pool.ResultSet.next(ResultSet.java:198)
at com.crs.action.CrsHierarchyHandler.execute(CrsHierarchyHandler.java:149)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:288)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:212)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2765)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2433)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:172)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:145)


CrsHierarchyHandler.java:149 points to this in the code:

rSet = dbCon.exeQRY(sqlStr);

Line 149:while (rSet.next()) {
hierarchyChunk = hierarchyChunk
+ (rSet.getString("location"));
hierarchyChunk = hierarchyChunk + "|"
+ (rSet.getString("location")) + "||";
}

This is inside a try block with a finally like:

finally {
try {
dbCon.closeConnection();
dbCon = null;
} catch (Exception ex) {
System.out.println(" Inside 2" + ex.toString());
forwardPage = "failure";
ex.printStackTrace();
}
}

This happened in the very first page on the application, so cannot be from anywhere else in the code. Its only happening when there is more than 1 user. Never happened for 1 user while testing.

Any suggestions?

[ June 08, 2006: Message edited by: Piyush Jain ]
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Check the access type of dbCon (Connection) inside your CrsHierarchyHandler.java. Whether it is declared at class level as "static". Since you have issue while trying with more than one user. This could be the reason.

Regards
Dhanaraj
 
Evacuate the building! Here, take this tiny ad with you:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic