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.
Up vote 1 down vote favorite share g+ share fb share tw.
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 java oracle websphere datasource link|improve this question edited Aug 30 '11 at 21:46Bo Persson23.2k51545 asked Jul 29 '11 at 18:20Sylvain412.
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 www-01.ibm.com/support/docview.wss?uid=s....
I'm not quite sure about this, though I don't really understand its purpose. I actually get an exception that I manage, but I want to "refresh" the data source when I catch that "socket close" exception. I don't need to retry to get another connection because they are all invalid.
Ex. : I start my server, when it's up, I close the VPN connection (DB is in remote network) and reconnect. Now my data source is not valid, no matter what.
I need to restart the server. There must be something like that in Websphere, no? – Sylvain Jul 29 '11 at 19:17.
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 www-01.ibm.com/support/docview.wss?uid=s... HTH Manglu.
Actually, I get a SQLException which says "Connection reset". The StaleConnectionException is unavailable... If what I read is good, I would need to import the Jar file utils. Jar from the Websphere jar libraries, but I would prefere not since the application is big enough.
I get that SQLException (which I catch) but I need like a Java procedure to flush the pool and refresh it. I don't think it's possible though... – Sylvain Aug 1 '11 at 13:29.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.