简体   繁体   中英

Websphere application server 5.1 DataSource no longer valid when DB is rebooted

First of all, we are running a Java Web application running on WAS 5.1. Behind that, we use an Oracle data base. The problem that we're faced to is really simple, but after a couple of hours of Google search, I decided to ask you.

We have an application that is running on WAS. When we start the server, WAS sets his DataSource so that it points to the data base. Everything works fine, expect when the DBAs have to reboot the data base server. When they do, the data source is no longer valid and we have to manually restart all server and we are currently trying to correct that, if possible. We need to find a way to do it because we have 3 pre-production environnement for for our application, and there are two servers associated with it, one for the application and the other is a report generator web service. So, when the DBAs wants to reboot the server (and they usually don't tell us!) we have to reboot six servers. I was wondering if in Java, there was a way to reset the data source so that we don't need to restart the servers.

For you information, WebSphere is v5.1 and Oracle is 9g with Java 1.4.2.17.

We also use RAD:

Version: 6.0.1 Build id: 20050725_1800

You should configure your application server to always test the connection before leasing it out to a client. I'm not familiar with Websphere that much, but in WebLogic, you can set a jdbc sql statement such as select 1 from dual and the container removes stale connections from the connection pool.

Here is a link on how to do it in Websphere

http://www-01.ibm.com/support/docview.wss?uid=swg21439688

Based on what i read from your note, you should receive Stale connection exception as WAS has stale handles (in its pool) as the DB has been restarted.

The Data Source configuration can be configured to purge the entire pool once a stale connection is detected. The default policy is to purge the individual connection.

Adopting this would prevent you from restarting your WAS Servers.

There are a number of resources in this space http://www-01.ibm.com/support/docview.wss?uid=swg21063645

HTH

Manglu

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM