Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

DisarmTransaction

DisarmTransaction()

Requests rollback and puts the transaction in TTSBREAK.

DisarmTransactionAdvPL
01 · OVERVIEW

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)

02 · SYNTAX

Syntax

DisarmTransaction()

Return value

Return not formalized here; the relevant effect is transactional.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed354()
    // Isolated demonstration: no writes or outer transaction.
    BEGIN TRANSACTION
        DisarmTransaction()
        Break
    END TRANSACTION
Return Nil
Expected result

Illustrates 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.

BEST PRACTICES
  • 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.

Related content

REFERENCES
  1. TOTVS. DisarmTransaction. TDN. Accessed on 2026-10-26.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha