Bug on TOraSession.Destroy (for Core Lab Team)

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
zzin32
Posts: 11
Joined: Fri 21 Oct 2005 13:12

Bug on TOraSession.Destroy (for Core Lab Team)

Post by zzin32 » Sun 03 Sep 2006 07:55

Calling TOraSession.Destroy (from odac) ends with error, if I, in this component, use property SQL.

Program written in Delphi 6 with large amount of threads, every thread contains TOraSession object.
(TOraSession.ThreadSafety = True). Ending program all TOraSessions are destroyed simultaneously and program 'hangs up'.

MySess: TOraSession;

// I use TOraSession property SQL.

(Ora.pas - source - TOraSesson class)
...
private
FDebug: boolean;
FOraSQL: TOraSQL; // !!! if I use SQL property, In program will be created this object,
...

But why I couldn't find place in source code where this object is destroyed??

Later it can create access violation when called TOraSession.Destroy because for FOraSQL destruction is automatically called:

(DBAccess.pas - source)

destructor TCustomDADataSet.Destroy;
...
if UsedConnection nil then
UsedConnection.UnregisterClient(Self); // !!! here I get access violation
...

and finally

(DB.pas - source)
procedure TCustomConnection.UnRegisterClient(Client: TObject);
var
Index: Integer;
begin
if Client is TDataSet then
FDataSets.Remove(Client);
Index := FClients.IndexOf(Client); // Error !!!, because FClients = nil
if Index -1 then
begin
FClients.Delete(Index);
FConnectEvents.Delete(Index);
end;
end;

-----------------------------

If I execute before MySess.Free:

...
var
MySess: TOraSession;
ConnSQL: TOraSql;
begin
...
ConnSQL := MySess.SQL; // !!!
FreeAndNil(ConnSQL); // !!!
MySess.Free;
...

Then problem disapears.

zzin32
Posts: 11
Joined: Fri 21 Oct 2005 13:12

Post by zzin32 » Sun 03 Sep 2006 15:29

???
If set
UseDefSession := False;
on starting programm, then all right.

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Mon 04 Sep 2006 10:25

Please send to ODAC support address complete sample that demonstrates this problem and include script to create server objects.

Post Reply