Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> pro*c - how to determine connection?
I cannot guarantee a stable connection of my application to the
database over a long time (a week or longer). I'm told to implement a
test to determine if the connection has broken. In this case I should
try a reconnect.
My idea to solve this problem is a simple SELECT that must be successful. I use "SELECT 1 FROM DUAL". I thought if this fails there's no connection and I can try to (re)connect using username, password and host. But this (re)connect fails if this SELECT is executed without an initial connection. The error is
"ORA-00001: violation against uniqueness, rule (%s.%s)" (sorry, this text is not original, mine is German).
My questions are: can I work around this? Or is there e better way to implement this test? Do I really have to test a connection or will it be reconnected itself if it has broken and should again be used?
T.M. Received on Fri Jun 17 2005 - 02:14:55 CDT