I did some tests about transaction processing on VFP 8.0, and I have been a little surprised to see that if I begin a transaction, then some runtime error occurs in my procedure before I ended the transaction, the transaction is not automatically rollbacked and is still pending. This means that a further END TRANSACTION could very well commit the failed transaction, or that more unnoticed pending transactions may get the TXNLEVEL() over 5 and generate an error.
How do expert Foxpro developers handle this ? Is this the reason for which I see many blocks like the following in my book's examples ?
DO WHILE TXNLEVEL()>0
ROLLBACK
For the moment I am tempted to include every transaction in a TRY...CATCH block, so that I can issue a ROLLBACK in the CATCH block.