Subject | Problem with transactions |
---|---|
Author | slsolutions2002 |
Post date | 2002-02-04T21:38:24Z |
Hello:
I have the following code:
dmTest.trSLS.StartTransaction;
Try
With qrTest Do
Begin
First;
While Not Eof Do
Begin
ApplyAdjustments1;
Next;
End;
End;
dmTest.trSLS.CommitRetaining;
Except
dmTest.trSLS.RollBackRetaining;
End;
The qrTest table has 1 record in it.
Problem is the loop executes twice. I step through it with the
debugger and it loops as though there were 2 records in the table.
It loops twice even if I comment out the call to ApplyAdjustments1 so
I am sure that routine is not causing the problem. However, if I
remove the transaction code so the code reads:
With qrTest Do
Begin
First;
While Not Eof Do
Begin
ApplyAdjustments1;
Next;
End;
End;
It works fine and only the 1 record is processed.
I assume I am doing something incorrectly with the transaction. Can
anyone help?
Thanks.
I have the following code:
dmTest.trSLS.StartTransaction;
Try
With qrTest Do
Begin
First;
While Not Eof Do
Begin
ApplyAdjustments1;
Next;
End;
End;
dmTest.trSLS.CommitRetaining;
Except
dmTest.trSLS.RollBackRetaining;
End;
The qrTest table has 1 record in it.
Problem is the loop executes twice. I step through it with the
debugger and it loops as though there were 2 records in the table.
It loops twice even if I comment out the call to ApplyAdjustments1 so
I am sure that routine is not causing the problem. However, if I
remove the transaction code so the code reads:
With qrTest Do
Begin
First;
While Not Eof Do
Begin
ApplyAdjustments1;
Next;
End;
End;
It works fine and only the 1 record is processed.
I assume I am doing something incorrectly with the transaction. Can
anyone help?
Thanks.