I am new to poolman 2.1 b1 .
I am very curious about how to pool a connection , so
i trace the code ...
But i am very confused about those code
in SQLManager.java
public void returnConnection(Connection con) {
try {
con.close(); <--------
} catch (SQLException se) {
}
}
---- > con.close();
it will call close() method of PoolManConnection.java
public void close() throws SQLException {
try {
clean();
this.con.close(); <--------
} catch (SQLException sqle) {
sendErrorEvent(sqle);
throw sqle;
}
}
AND THE STRANGE THING IS ----> this.con.close();
it did Close the physical Connection.
and didn't use checkin this connection to JDBCPool
Could some one figure out where i am wrong ????
In my option , I think in returnConnection(Connection
con) method in SQLManager.java should modify to be
like this
public void returnConnection(Connection coon) }
assertLoaded();
try {
JDBCPool pool = (JDBCPool)this.defaultpool;
return pool.returnConnection();
} catch (NullPointerException ne) {
throw new SQLException("No default pool!
Check your poolman.xml");
}
}
Logged In: NO
You're looking at legacy code. The connection handed out
by the DataSource is actually a PoolManConnectionHandle.
The close call chain looks like this:
PoolManConnectionHandle.close
PoolManConnection.sendCloseEvent
JDBCPool.connectionClosed
JDBCPool.returnConnection
PoolManConnection.clean...