• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Need help with a graceful failed database connection recovery

 
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.
 
Bartender
Posts: 11445
18
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • 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.
 
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.
 
ice is for people that are not already cool. Chill with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!