Icon View Incident Report

Serious Serious
Reported By: Phillip Percival
Reported On: 8/4/2004
For: Version 4.09 Build 1
# 1803 Closing One Dataset Connected to the Same Database As Another Dataset Can Cause 2nd Dataset To Close

Using 4.09 now however I notice that if a database where KeepConnections=FALSE is active and I create/open a dynamic query while processing another query, the freeing/closing of the second query calls TDBISAMDatabase.CloseDataSets() eventually so when I return to processing the first query it is no longer active. Both queries briefly use the SessionName and DatabaseName of the TDBISAMsession, TDBISAMdatabase components from a global module.

Setting TDBISAMdatabase.KeepConnections property to TRUE solves the problem but I don't think this is correct. Sounds like TDBISAMdatabase.Datasets[] is not populated properly or is ignoring Queries or queries whose owner is nil.

qry := TDBISAMquery.Create(nil)
qry.SQL.text := ....
qry.Open;
qry.First;
while not qry.Eof do
begin
qry2 := TDBISAMquery.Create(nil);
qry.SQL.text := ....
   qry2.Open;
... do something with qry2
qry2.Close;
qry2.Free;

/// qry.Active is FALSE AT THIS POINT.

qry.Next;
end;



Comments Comments
The KeepConnection property of the TDBISAMDatabase component must be False for this to fail. By default, the KeepConnection property is set to True, or for temporary databases it is set to the same setting as the TDBISAMSession.KeepConnections property.


Resolution Resolution
Fixed Problem on 8/4/2004 in version 4.10 build 1
Image