• 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

Recognizing stale connections in connection pool

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know the best way to identify stale connections in a connection pool? Our application resides on a webfarm and connects to a DB2 database on an OS/390 mainframe using DB2Connect. The problem is the database is set to break connections after 10 minutes but the database does not notify DB2Connect when a connection has timed out and therefore my connection pool class still thinks the connection is available thus causing errors when a servlet grabs a stale connection.
What is the best way for the connectionpool class to determine if the connection is still valid? (I've tried connection.isClosed() and this does not work) Would getMetaData be an option? Or what about a simple query to test it? Any help is greatly appreciated!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic