tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46200] New: jdbc-pool needs to close opened assets too
Date Thu, 13 Nov 2008 17:31:33 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46200

           Summary: jdbc-pool needs to close opened assets too
           Product: Tomcat 6
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: funkman@joedog.org


Given the following psuedo code:

for (i in 0..10) {
    Connection con = datasource.getConnection();
    Statement st = con.createStatement();
    ResultSet rs = null;
    for (j in 0..50) {
        st = con.createStatement();
        rs = st.executeQuery("select '${i}.${j}' from dual");
    }
    // notice the lack of closing the rs, and st
    con.close();
}

This will blowup depending on your database vendor's config on how many open
cursors can be open at a given time.

Connection.close() implies that all Statements and PreparedStatements should
also be closed too.

Of course the above is subject to interpretation - but I've seen to many times
int he wild Connections which are opened but its statements/result sets are
not.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message