Hi , I am having a very practical problem . I am running my application on Websphere Application Server unsing Oracle Database . The WAS connection pool is used to connect to the Oracle DB . I am forcefully stopping the database server in the mid of my application. Then I am starting the DB server again . Now I am trying to run the Application again . but at the frist instance of database connection it is giving this exception even thoough database server is running. ******************************************************** com.ibm.ejs.cm.portability.StaleConnectionException: Io exception: Connection reset by peer: socket write error ********************************************************* When i am trying for the second time to acess the databse it is able to get the connection without any problem and application is running fine. Can anyone tell me how to get the connection in the very first access to the database after it is shutdown and restart. Waiting for your kind reply, Thanks is Advance, Sailendra Panigrahi
Andy Rodriguez
Ranch Hand
Joined: Oct 16, 2001
Posts: 95
posted
0
You are hit by a "stale connection" bug when using connection pool . Which ver of WAS are you using ?The whole point in using the pool is to avoid multi open and close to a dbase . So if the db is shut down momentarily or the cleaning lady pulls the plug off the server to attach the vaccum cleaner late in the evening ( has happened before - not kidding ) then the connection pool needs to be flushed , that is exactly what you are experiencing .This can be handled gracefully by looking up the vendor error code (oracle in this case - not sure what it throws up as ??? ) and then flush and reconn .
My ramblings @<br /> <a href="http://javarecon.tripod.com" target="_blank" rel="nofollow">http://javarecon.tripod.com</a>
Andy Rodriguez
Ranch Hand
Joined: Oct 16, 2001
Posts: 95
posted
0
Quick look at my app showed that your statement in deprecated in v4.0 so you must be on 3.5 . In 4.0 jdbc2.0 , catching the exception explicitly is not required , but in was3.5 i am assuming it is ! check to see if SQLexception is caught in ur app , i am hoping staleexception would extend sqlexcep...else...
Hi Skinner Seymour , I am using WAS v3.5.4 and JDBC2.0 . My client wants that after the DB is shut down and restarted , the application should start on the first connection to the DB . At present , on the 1st connection to DB after DB is shut down and restarted , connection pool is getting destroyed and connection pool is in "Does not exit" state . and the next time when DB ic connected teh connection poool is created. What we need is that , at the very 1st instance of DB connection after DB is shutdown and retstared , Connection pool should be destroyed ( which is happing now ) and new connection is created ( which is not happening ) can anybody know , is there any facility available is Websphere v3.5.4 application server which will do this dual purpose .so that at the very 1st connection of DB , we will able to run our application. thanks is advance Sailendra Panigrahi