orasession detecting killed session

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
bjk002
Posts: 1
Joined: Thu 14 Sep 2006 15:52

orasession detecting killed session

Post by bjk002 » Thu 14 Sep 2006 16:04

A quick question for you ODAC/Oracle gurus...

ODAC 5.8 component suite, Delphi 7.0, TOraSession, Oracle 8i...

I want to be able to detect if a session was killed (at the oracle server), but cannot seem to find a way without attempting a query, etc...

Sequence of events is:

1. Connect session to DB
2. Query "Connected" property = TRUE //good
3. Kill session at oracle server
4. Query "Connected" property = TRUE //BAD

Problem:

If you query the "Connected" property after killing a session on the oracle server, the "Connected" property still reports TRUE. (OCISvcCtx also seems to think it still has a valid handle at this point).

Question:

Is there some way to detect (other than attempting to run a query and handling exception) when a session associated with component has been killed?

2nd Question:

Why would this be the default behaviour of the "Connected" property? I cannot think of a good reason (granted, I'm no guru) that on querying this property that it shouldn't make a call back to the session to validate it status?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 15 Sep 2006 10:26

There is no way to detect that a session was killed except attempting to execute some query.
ODAC does not execute any query to database when reading TOraSession.Connected property because such behaviour is optimal for most users.

Post Reply