Icon View Incident Report

Serious Serious
Reported By: Abdulaziz Jasser
Reported On: 6/23/2007
For: Version 1.04 Build 2
# 2391 Updating the Same Row Multiple Times Within a Transaction Causes Row Lock Error

Is it possible to edit the same record many times from the same session within a transaction? I am having a problem doing this with EDB 1.04 build 2.

I am getting error #1005. In a transaction, I update some records in the same table many times. In I am getting this error when in the second time of the update. My code is something like the following:

EDBDatabase1.StartTransaction;

for i:=1 to 10 do begin

    sSQL := 'SELECT AccountNo,AccountBalance '+
            'FROM TB_AccountBalances '+
            'WHERE BranchSysNo = %d AND YearSysNo = %d AND '+
            'AccountNo IN %s';
    sSQL := Format(sSQL, UserData.BranchSysNo,
                   rUserData.YearSysNo, rAccounts.ParentAccounts]);
    GetRecord(qryAccounts,sSQL);

    while NOT qryAccounts.Eof do begin
            qryAccounts.Edit;
            qryAccounts['AccountBalance'] := qryAccounts['AccountBalance'] +
                                             rAccounts.DebitAmount;
            qryAccounts['AccountBalance'] := qryAccounts['AccountBalance'] - 
                                             rAccounts.CreditAmount;
            qryAccounts.Post;
            qryAccounts.Next;
    end;

end; //end for

EDBDatabase1.Commit;



Resolution Resolution
Fixed Problem on 6/24/2007 in version 1.04 build 3


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

Image