Show TOC

Transactional Consistency CheckLocate this document in the navigation structure

Definition

A transactional consistency check takes place when processing bgRFC units (language element CALL FUNCTION <func> IN BACKGROUND UNIT) and this avoids ABAP language elements that could lead to a commit being used in the unit execution of the application.

Sychronous and asynchronous RFCs ( CALL FUNCTION <func> DESTINATION), WAIT, COMMIT WORK, ROLLBACK WORK, HTTP communication (using the class CL_HTTP_CLIENT), and calling the function module DB_COMMIT belong to these language elements. An explicit ROLLBACK WORK is not permitted. However, a rollback can be executed using the statement MESSAGE.

Error Messages

While calling the ABAP language elements for the ABAP runtime error SYSTEM_ILLEGAL_STATEMENT, the execution of an implicit commit creates the ABAP runtime error DBIF_DSQL2_DEFAULT_CR_ERROR using the function module call DB_COMMIT.

Background

The reason for this check is that after a commit (for example, initiated by an RFC), all database actions that were previously executed in the unit (such INSERT, MODIFY, UPDATE, and DELETE) are persisted on the database. If after this action the application terminates the related unit with an error (such as MESSAGE E, A, or X) then you cannot rollback the entire unit ( Logical Unit of Work).

Executing the unit again would lead to the same database inconsistency.

Changes to Runtime Behavior

You can change this runtime behavior by either deactivating the transaction consistency check when creating bgRFC units (using the method IF_BGRFC_UNIT~DISABLE_COMMIT_CHECKS) or by modifying the application so that no actions are executed which could cause a commit or a rollback.

Here, however, you are allowed to implement the language element MESSAGE for logging errors.

Note

Deactivating the consistency check can only be done after a close analysis of the SAP LUW in the generated bgRFC unit. Otherwise if a unit is terminated it could happen that data is logged more than once in error.

Caution

The transactional integrity of a bgRFC cannot be garanteed if the method DISABLE_COMMIT_CHECKS was called.