Re: [cx-oracle-users] best way to detect and recover broken connection?
Brought to you by:
atuining
From: Frank v. L. <fvl...@ca...> - 2006-12-05 08:14:33
|
We had to deal with a similar problem of loosing a connection. What we do is to store a queue of all queries (updates,inserts, and deletes) made during a transaction. If for some reason the connection is lost before a commit we re connect and execute the queries again in the same order. After a commit we empty the queue for that transaction. This has worked quite well. I must add that we seldom drop a connection. We try to keep transactions and connection time short, but we do not have thousands of transactions a minute. In the past we also used a connection cache. So we have long running open connections that are more likely to disconnect once in a while, in combination with the query queuing. This made the system more responsive when we deal with many transactions as connecting every time gives some overhead. To minimize unexpected connection losses we refreshed the connection once in a while. Frank. Anthony Tuininga wrote: > No, there is no way to globally catch a disconnection. The first time > you will be aware of it is when you make a query and the exception > "not connected to database" (or something similar) is raised. A number > of people perform a "ping" first (execute the statement "select 1 from > dual") before attempting their own query. If that query fails, they > estabilish a new connection and use that instead. I'm not aware of any > other techniques so if anyone else has any to share, please do so. > > On 12/4/06, Mark Harrison <mh...@pi...> wrote: >> Here's kind of a general connection question. >> >> I've got an application server (xml-rpc based) with >> a long-lived persistent connection. >> >> Of course, the appserver needs to handle the eventuality >> that the connection will be closed at some time. >> >> What's the best way to handle this? Is there some nice >> way to globally catch a disconnection and automatically >> reconnect, or some such? >> >> Many TIA! >> Mark >> >> -- >> Mark Harrison >> Pixar Animation Studios >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share your >> opinions on IT & business topics through brief surveys - and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users -- -------------------------------------- Frank van Lingen California Institute of Technology CA 91125 Pasadena United States -------------------------------------- Mail Code:356-48 bld :340 Lauritsen email :fvl...@ca... im(aim) :marcellus0872 tel :(+1) 626 395 3862 url :http://www.vanlingen.name/ -------------------------------------- |