Help Center> GaussDB> Distributed_8.x> Autonomous Transaction
Updated on 2024-06-03 GMT+08:00

Autonomous Transaction

An autonomous transaction is an independent transaction that is started during the execution of a primary transaction. Committing and rolling back an autonomous transaction does not affect the data that has been committed by the primary transaction. In addition, an autonomous transaction is not affected by the primary transaction.

Autonomous transactions are defined in stored procedures, functions, and anonymous blocks, and are declared using the PRAGMA AUTONOMOUS_TRANSACTION keyword.