We have a new tool on our QA servers (EJB with UDB) that tells us the number of instances of various classes at any point in time. One of the guys monitored PreparedStatements and saw the number go up and down over time and then settle down at 16 when the test was idle. PS are cached on a per-connection basis; does this stable 16 sound like that cache? Guess I should look up the connection pool minimum size and see what it is.
At the same point in time he found 17 ResultSet objects. Would they be attached to cached PreparedStatements or cached for some other reason? Did we fail to close them or something silly? Or maybe a plain old memory leak?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Are you executing a stored procedure which is returning multiple ResultSets?
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Joined: Jan 29, 2003
Nope, just queries, most generated by a data mapping tool, some written by hand. Even with the hand-thrown SQL we go through generated DAOs to execute, so things like handling exceptions and closing connections is consistent - whether it's correct or not remains to be seen.