set multilocks on tryAgain=0 for nloop=1 to 10 do while .t. select tableA replace... select tableB replace... insert into tableC... begin transaction allOk=.n. select tableA if tableupdate(.t.) select tableB if tableupdate(.t.) select tableC if tableupdate(.t.) allOK=.y. endif endif endif if allOk end transaction else rollback tryAgain=tryAgain+1 if tryAgain<3 wait window 'Rollback but try again '+str(tryAgain) loop endif wait window 'Rollback and go next' timeout 5 endif wait window 'pause for 5 seconds, how many loop:'+str(nloop) timeout 5 exit enddo next nloopI started the app in 2 PCs, after the third loop, PC #1 got an error:
File is in use by another user.then Rollback
Rollback but try again 1 Rollback but try again 2 Rollback and go next pause for 5 seconds, how many loop: 3 Rollback but try again 1 Rollback but try again 2 Rollback and go next pause for 5 seconds, how many loop: 4... and so on until the last loop