• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connection - Statement Cleanup

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are running Websphere 5.1 on a Mainframe and connecting to DB2 7.0 on O/S 390 using a type 2 driver.

When I obtain a connection, create a statement on it, use it and forget to close the statement, when i release the connection using connection.close(), will websphere close any remaining statements/resultsets before returning the connection back to the pool?

I could really make sure all my statements get closed by giving my programmers my own connection object, track what all statements were created, and close any open statements them when the connection is closed (returned back to the pool), but if websphere is already doing it for me, I might as well get a free ride :-)
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dushy,
The Statement and ResultSet are considered abandoned. They will get cleaned up at some point, but you are likely to have a resource leak in the meantime.
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic