This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JDBC 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
Bookmark "recreating damaged connection in pool" Watch "recreating damaged connection in pool" New topic
Author

recreating damaged connection in pool

Srinivas Rao
Greenhorn

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
Marshal

Joined: May 26, 2003
Posts: 30580
    
154

"Srinivas",
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.

Thanks,
Jeanne
JDBC Forum Bartender


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, 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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: recreating damaged connection in pool