tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 46200] New: jdbc-pool needs to close opened assets too
Date Thu, 13 Nov 2008 17:31:33 GMT

           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

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

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

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message