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.
Bug on TOraSession.Destroy (for Core Lab Team)
-
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53