Simulate Lost DB Conection.

Hi, I've searched for info on how to do this but havent found anythin, or if its possible, other than actually taking the DB down. When our server starts it pulls data from the DB and stores it in the cache. Now when the server is running if the database goes down then comes back up and be try and refresh a cache it still see's the DB as being down, even though at this stage it is back. I need to reconnect but am having problems at the minute. Dont fancy asking for the DB to be brought down everytime I try something new!

Any help would be much appreciated.

Thanks

[590 byte] By [joeJacka] at [2007-11-27 10:03:43]
# 1
Your connections are being cut. You need to establish new connections.
masijade.a at 2007-7-13 0:38:41 > top of Java-index,Java Essentials,Java Programming...
# 2
I usually just disconnect my computer from the network (since our database is located on a remote machine)
kajbja at 2007-7-13 0:38:41 > top of Java-index,Java Essentials,Java Programming...
# 3
I'll try that but I was told it wouldnt work!
joeJacka at 2007-7-13 0:38:41 > top of Java-index,Java Essentials,Java Programming...
# 4
> I'll try that but I was told it wouldnt work!Sounds like something to be challenged. Whenever someone simply says "that won't work" ask them to explain why
georgemca at 2007-7-13 0:38:41 > top of Java-index,Java Essentials,Java Programming...
# 5
Argh! Ok disconnecting the cable for a few seconds got me getting the error I wanted. But I cant figure out how to reestablish/refresh the connection!!
joeJacka at 2007-7-13 0:38:41 > top of Java-index,Java Essentials,Java Programming...
# 6

> Argh! Ok disconnecting the cable for a few seconds

> got me getting the error I wanted. But I cant figure

> out how to reestablish/refresh the connection!!

There isn't a permanent connection to be re-established. They're created as needed. What actually goes wrong?

georgemca at 2007-7-13 0:38:41 > top of Java-index,Java Essentials,Java Programming...
# 7
If the db goes down then comes back up while the server is running, even after its backup I get :Io exception: Connection reset by peer: socket write error for pool:
joeJacka at 2007-7-13 0:38:42 > top of Java-index,Java Essentials,Java Programming...
# 8
I think it may be a firewall issue which means that I cant actually replicate the db going down by just "pulling the network cable out then reinserting it again"Would I be right?
joeJacka at 2007-7-13 0:38:42 > top of Java-index,Java Essentials,Java Programming...
# 9
anyone?
joeJacka at 2007-7-13 0:38:42 > top of Java-index,Java Essentials,Java Programming...
# 10

Pulling the network cable creates (or can create) other problems than just the app can't find the db anymore. What db platform are you using? With Oracle when we want to simulate db failures we have the DBA folks stop the db but leave the listener going so the application thinks the db is running but gets nothing back.

PS.

puckstopper31a at 2007-7-13 0:38:42 > top of Java-index,Java Essentials,Java Programming...