• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Websphere Connection Pool problem

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Andy Rodriguez
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sailendra, there's a message for you here: http://www.javaranch.com/ubb/Forum36/HTML/000288.html

Pauline
 
pani_pani2000
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Beauty is in the eye of the tiny ad.
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic