DF_TRANABORT_ONERROR
See Also
Description
Indicates whether control should jump to the end of an implicit transaction when an error occurs during a transaction.
Level
Global
Type
Boolean, temporary
Access
Read / Write
Values
- True
- False
Remarks
DataFlex will not abort an implicit transaction if an error occurs. This behavior is consistent with the behavior that existed when explicit transactions were not supported.
When set to True, DataFlex will abort an implicit transaction if an error occurs. The flow of the program, however, will not jump out of the implicit transaction but continue on the next line. This behavior is usually not desired.
For example, if an implicit transaction tries to save three records and an error occurs while trying to save the second record, the transaction will be rolled back, but control will not jump to the end of the implicit transaction. In this case, it will still try to save the third record. The rollback has removed the lock, resulting in the DFERR_EDIT_WITHOUT_REREAD (4155) error. This can be avoided by setting the DF_TRANABORT_ONERROR attribute to True.
Due to the behavior of implicit transactions when the attribute is set to True, it is recommended to use the default value.
The DF_TRANABORT_ONERROR attribute only affects implicit transactions. An implicit transaction is a transaction that is started via the Lock or Reread command and ended via the Unlock command. An explicit transaction is started by the Begin_Transaction command and ended by the End_Transaction command.