To avoid most of the UpdateConflicts / DeadLock errors while update a record in a table, just use the "reRead( )" method of the table before making any changes to the selected record of the table.
Ex :
;
ttsbegin;
select forUpdate tSalesLine where tSalesLine.SalesId = = 'SO-1234567';
tSalesLine.reRead( );
tSalesLine.Feild1 = XXXXX;
tSalesLine.Feild2 = XXXXX;
tSalesLine.update( );
ttscommit;
Ex :
;
ttsbegin;
select forUpdate tSalesLine where tSalesLine.SalesId = = 'SO-1234567';
tSalesLine.reRead( );
tSalesLine.Feild1 = XXXXX;
tSalesLine.Feild2 = XXXXX;
tSalesLine.update( );
ttscommit;
No comments:
Post a Comment