Icon View Incident Report

Minor Minor
Reported By: Piotr Front
Reported On: 9/29/2010
For: Version 2.04 Build 3
# 3324 Freeing a TDataSet Descendant Without Closing Can Cause Dangling Row Locks

I think the following code is a bug because problem exist only when we open table at start (before creating first query in code). Without the table open, exception don't occur because with destroying query row lock is canceled.

procedure TForm2.btnRUNClick(Sender: TObject);
var lQuery : TEDBQuery;
begin
  table.Open;
  table.First;
  lQuery := TEDBQuery.Create(nil);
  try
    lQuery.RequestSensitive := true;
    lQuery.SessionName := session.SessionName;
    lQuery.DatabaseName := database.DatabaseName;
    lQuery.SQL.Text := 'SELECT * FROM '+table.TableName;
    lQuery.Open;
    lQuery.Edit;
  finally
    lQuery.Free;
  end;

  lQuery := TEDBQuery.Create(nil);
  try
    lQuery.RequestSensitive := true;
    lQuery.SessionName := session2.SessionName;
    lQuery.DatabaseName := database2.DatabaseName;
    lQuery.SQL.Text := 'SELECT * FROM '+table.TableName;
    lQuery.Open;
    lQuery.Edit;
  finally
    lQuery.Free;
  end;
end;



Comments Comments and Workarounds
The problem was in the ElevateDB TDataSet descendant code. During a Destroy operation, the base TDataSet code does not call DoBeforeClose, which was where ElevateDB was cancelling any pending Insert/Edit/SetKey operation.


Resolution Resolution
Fixed Problem on 9/29/2010 in version 2.04 build 4


Products Affected Products Affected
ElevateDB LCL Standard with Source
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image