I'm using bonecp v0.8.0 (which I believe is the latest), paired with Mysql Connector/J 5.1.6
Suppose I have the following code
BoneCP pool = new BoneCP(...);
Connection origConn = pool.getConnection();
Statement origStmt = conn.createStatement();
...
ResultSet rs = origStmt.executeQuery(...);
...
Statement newStmt = rs.getStatement();
Connection newConn = newStmt.getConnection();
rs.close();
newStmt.close();
newConn.close();
In the above code, it seems that while origConn==newConn, origStmt!=newStmt. I found this odd.
I also found that if I close the newStmt, and not the origStmt, my connections tend to grow without ever being freed back into the connection pool. This ultimately leads to my app running out of connections and freezing (when it requests a new connection).
The javadocs leads me to believe that ResultSet.getStatement() returns me the same Statement object that created it, but maybe this is not the case with BoneCP.
Anyone know what's happening here?