Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

DBCommit

DBCommit() --> Nil

Flushes pending updates in the current work area.

DBCommitAdvPL
01 · OVERVIEW

Overview

DBCommit flushes pending record updates in the current area and returns Nil. It is neither validation nor a universal replacement for END TRANSACTION. The reference notes that navigation operations can flush automatically. Avoid repeated loop calls without understanding cost and any outer transaction. EDTRB identifies only an owned test table already open with the required schema and permissions; examples are not intended for standard tables. (TOTVS, n.d., ref. 1)

02 · SYNTAX

Syntax

DBCommit() --> Nil

Return value

Nil; not a logical success indicator.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed326()
    // Fragment: owned updates already validated in EDTRB.
    If Select("EDTRB") > 0
        EDTRB->(DBCommit())
    EndIf
Return Nil
Expected result

Requests flushing in the test context; Nil does not prove business success. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check RDD, alias and pending operations. Navigation can flush updates; preserve context under the caller contract and handle errors in the complete routine.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. DBCommit. 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