DisarmTransaction
DisarmTransaction()Requests rollback and puts the transaction in TTSBREAK.
Overview
DisarmTransaction affects the protected work since the first BEGIN TRANSACTION, including nested levels. After the call, flow must leave through BREAK past the appropriate END TRANSACTION or terminate the thread; a new transaction cannot start while TTSBREAK remains. TOTVS prohibits BeginTran/EndTran for Protheus transaction control. The fragment illustrates failure in its own block without real writes. Do not insert it into a borrowed transaction without understanding outer levels. (TOTVS, n.d., ref. 1)
Syntax
DisarmTransaction()Return value
Return not formalized here; the relevant effect is transactional.
Commented example
#Include "Protheus.ch"
User Function Ed354()
// Isolated demonstration: no writes or outer transaction.
BEGIN TRANSACTION
DisarmTransaction()
Break
END TRANSACTION
Return NilIllustrates leaving a disarmed transaction without business persistence. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Do not start further transactional processing before passing all pending END TRANSACTION statements.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.