Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PreparedStmt Cache ... ResultSets?

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you executing a stored procedure which is returning multiple ResultSets?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic