It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes recreating damaged connection in pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "recreating damaged connection in pool" Watch "recreating damaged connection in pool" New topic

recreating damaged connection in pool

Srinivas Rao

Joined: Aug 05, 2004
Posts: 14
Hi Ranchers,

We are using jrun 4.0 connection pool for connecting to oracle 9. Apart from the connection pool, we are externally managing (to allocate the connection to the user) and giving the connection from the pool based on our own logic. After some time of running the application, one/few connections are timedout and returned to the pool as a stale/damaged connections. When my logic gives me the staled connection, further DB operations are failing. So I want to know

1. Is there any way in Jrun Connection pool to check the staled connections and recreate them in the pool itself?
2. Or when the connection pool returns me the connection, did I need to check for the valid connection and recreate and return if it is stale (how to recreate and return to pool)?
3. Which method is better or any other way which will manage stale connections properly?

Thanks in advance
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

We're pleased to have you here with us in the JDBC forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

JDBC Forum Bartender

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
read this nice article fro m IBM, which gives complete explanation on how to handle stale connection retrieved from pool.

Stale Connections explanation
I agree. Here's the link:
subject: recreating damaged connection in pool
It's not a secret anymore!