What I also find an important point is that if you use Begin/End_Transaction, you'll get a compiler error when there is a mismatch. In other words, if you forget an unlock, you can get into trouble. If you forget an End_Transaction, the compiler throws an error.


And below some code that shows the different behaviour when an error occures.
Code:
Use DFAllEnt.pkg
Object oApplication is a cApplication
End_Object


Procedure Test1    
    Showln 'lock'
    Lock
        Showln 1
        Error DFERR_PROGRAM 'x'
        Showln 2
        Showln 3
        
        // Saverecord
    Unlock
End_Procedure


Procedure Test2
    
    Showln ''
    Showln 'Transaction'
    
    Begin_Transaction
        Showln 1
        Error DFERR_PROGRAM 'x'
        Showln 2
        Showln 3
        
        // Saverecord    
    End_Transaction
End_Procedure


Send Test1
Send test2


Send Info_Box ''