• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help with a graceful failed database connection recovery

 
phil foster
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a portal application that communicates with an Oracle database via a JDBC connection setup as a datasource in our WebSphere Application Server (v6.1) to make use of proper connection pooling. Due to circumstances that we can’t control the network link to the database is occasionally down (this is rare, and it has to do with our service provider that helps us communicate to the database that is overseas). When the connection is down it takes about 3 minutes for our application to realize it is down. What do I need to code, or change in the datasource, that will allow the application’s attempt to get the connection to timeout? If there hasn’t been a response in 10 seconds, then it is down and I want to display a nice message to the end user. I’ve tried changing several different parameters in the datasource setup but can’t find any that do what I need. Some settings I changed are:
Connection Timeout, Reap time,Unused Timeout, loginTimeout, Stuck timer time, Stuck time, Stuck threshold.
 
Maneesh Godbole
Saloon Keeper
Posts: 11312
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Phil,
Welcome to the Ranch.

I think your question would be more suitable for the JDBC forum. I will move it there for you.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some settings I changed are:
Connection Timeout, Reap time,Unused Timeout, loginTimeout, Stuck timer time, Stuck time, Stuck threshold.


Have you chnaged these programatically inside your DBConnect class of your Application or with the help of server Datasource settings ??

Not sure whetehr works or not , but just a guess
Have you tried using

getLoginTimeout()
Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.


void setLoginTimeout(int seconds)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.




 
phil foster
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I set the loginTimout property of my DataSource object in the code it does not change. When I print it out it is still zero. Setting the loginTimout property of the DataSource by configuring it on the server also does not work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic