Icon View Incident Report

Serious Serious
Reported By: Fernando Dias
Reported On: 9/23/2008
For: Version 2.01 Build 5
# 2809 Transaction Commit or Rollback Can Cause an AV

I'm getting an AV while editing records inside a transaction.

procedure TForm1.Button1Click(Sender: TObject);
var
  Num:integer;
  Nome:string;
begin
  EDBDatabase1.Open;
  EDBDatabase2.Open;
  EDBDatabase2.StartTransaction(EmptyEDBStringsArray);
  try

    //if you comment out the following line (EDBDatabase2.Execute(...) ,
    // then everything will run just fine
    EDBDatabase2.Execute('UPDATE "DadosPessoais" SET Actualizado=False');

    T1.Open;
    T2.Open;
    try
      Progressbar1.Max:=T1.RecordCount;
      T1.First;
      while not T1.Eof do
      begin
        //if you comment out the following line (if T1. ...) ,
        //then you will get "Error#1006 Cannot unlock row..." instead of the AV
        if T1.FieldByName('Delegacao').AsInteger=0 then
        begin
          Num:=T1.FieldByName('NumCliente').AsInteger;
          Nome:=T1.FieldByName('Nome').AsString;
          if T2.Findkey([Num, Nome]) then
          begin
            T2.Edit;
            //I removed all code here since it doesn't influence the test
            T2.Post;
          end;
        end;
        T1.Next;
        Progressbar1.StepIt;
      end;
    finally
      T1.Close;
      T2.Close;
    end;
    EDBDatabase2.Execute('DELETE FROM "DadosPessoais" WHERE '+
                         '(Actualizado=False) and (Delegacao=0)');
    EDBDatabase2.Commit;
  except
    EDBDatabase2.Rollback;
    raise;
  end;
end;



Comments Comments
The problem was due to the row unlock code that occurs during a commit or rollback when rows have been locked inside of the transaction.


Resolution Resolution
Fixed Problem on 9/24/2008 in version 2.02 build 1


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image