Skip to content

Not recommended using of RollbackTransaction method (WrongUseOfRollbackTransactionMethod)

Type Scope Severity Activated
by default
Minutes
to fix
Tags
Error BSL Critical Yes 1 standard

Description

You should call at first RollbackTransaction method in Exception block, and then execute other actions if required.

Examples

BeginTransaction();
Attempt
    CommitTransaction();
Exception
    WriteLogEvent(NStr("en = 'OperationExecution'"),
EventLogLevel.Error,
        ,
        ,
        DetailedErrorPresentation(InformationAboutError()));
    RollbackTransaction();
    CallException; // there is external transaction
EndTry;

Sources

Transactions: Rules of Use (RU)

Snippets

Diagnostic ignorance in code

// BSLLS:WrongUseOfRollbackTransactionMethod-off
// BSLLS:WrongUseOfRollbackTransactionMethod-on

Parameter for config

"WrongUseOfRollbackTransactionMethod": false