• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Losing Network Connection

 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a couple of applications that are connecting to a DB2 database. Every once in a while, we will lose our network connection to the PC that one of these apps is running on. When the network connection comes back, everything on the PC works fine, except the application. It's like it is not picking back up the network connection after it lost it. I have to stop and restart the application over again, to get it to work. Is there any way to make the application pick up the network connection after being lost without restarting it?

Thanks~
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jennifer,
We had a similar problem where trying to get the connection a second time helped. Not sure if it will work for you, but it's worth a shot.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jennifer,
Once the network connection is gone, the database session is lost. When the network connection is restored, the database session is not restored. As Jeanne says, you need to create a new database session by re-connecting to your database.

Good Luck,
Avi.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use connection pooling, you may be able to get automatic reconnection from the pool to the database.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic