This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

PreparedStmt Cache ... ResultSets?  RSS feed

 
(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?
 
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!