File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Websphere Connection Pool problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "Websphere Connection Pool problem" Watch "Websphere Connection Pool problem" New topic
Author

Websphere Connection Pool problem

pani_pani2000
Greenhorn

Joined: Dec 07, 2001
Posts: 7
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
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 @
http://javarecon.tripod.com


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
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...
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4011
Sailendra, there's a message for you here: http://www.javaranch.com/ubb/Forum36/HTML/000288.html

Pauline
pani_pani2000
Greenhorn

Joined: Dec 07, 2001
Posts: 7
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
 
 
subject: Websphere Connection Pool problem
 
Threads others viewed
WAS 6.1 Thread management
Websphere Connection Pool problem
Problem in websphere Connection pool
Rational Web Developer 6.0
Connection pool and restart database problem
IntelliJ Java IDE