Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

PreparedStmt Cache ... ResultSets?  RSS feed

 
(instanceof Sidekick)
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?
 
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)
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!