TOracleSession.Connected

ChristofK

Member
Hi,

during a database session, I get an exception E:EOracleError when I disconnect my computer from the network. Thats OK. During the exception handling, I use the command session.connected:=false with result of another exception. not using this command, outside of the exception handling the worth of session.connected is true, inspite of beeing completely disconnected from the network.
has anybody had similar problems?
Thanks for any proposals!

Chris
 
Do you mean that after setting Connected to False it is still True?

Or do you mean that Connected = True after you have disconnected your PC from the network? This is normal, because the TOracleSession does get a signal that this has happened. The Connected property will only be False after explicitly setting it to False, calling LogOff, or calling CheckConnection.

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
Do you mean that after setting Connected to False it is still True?

Or do you mean that Connected = True after you have disconnected your PC from the network? This is normal, because the TOracleSession does get a signal that this has happened. The Connected property will only be False after explicitly setting it to False, calling LogOff, or calling CheckConnection.


Thanks a lot for Your reply!

You say: 'because the TOracleSession does get a signal that this has happened.'

my question: How can I detect the status of TOracleSession.
Is the combination of
- CheckConnection and
- if (Connected = True)
the answer?

Thanks in advance!
 
Tne expression (Connected and (CheckConnection(False) = ccOK)) should indeed indicate whether you have a good connection or not. The CheckConnection function also allows you to re-establish the session though. If Connected = False then obviously you simply need to connect.

------------------
Marco Kalter
Allround Automations
 
however, CheckConnection() will not work if you have Internal Connection Pooling turned on for your oracle session component. You will receive ccReconnected, but the underlying pooled connection will not actually have been repaired. I posted a possible fix for the problem a while back on these boards.
 
Originally posted by mkalter:
Tne expression (Connected and (CheckConnection(False) = ccOK)) should indeed indicate whether you have a good connection or not. The CheckConnection function also allows you to re-establish the session though. If Connected = False then obviously you simply need to connect.

Thanks a lot, the expression (Connected and (CheckConnection(False) = ccOK)) works without provoking an exception as the expression if(connected=True) does when the network connection was interrupted.
 
Back
Top