Autonomous Transaction
The processing part inside autonomous transaction is independent from the main procedure. Regardless of the main transaction commit or rollback, autonomous transaction changes are not affected. A default’ COMMIT’ is triggered at the end of autonomous transaction.
Let’s start- Below we have table entry and we are trying to update the URL for a CARRID in autonomous transaction section though the main procedure has a ROLLBACK.
In the below AMDP procedure, an autonomous transaction section is declared and we have an DB UDPATE happens in the auto transaction section.
Here in the report we just call the AMDP method and finally we have a ROLLBACK.
Execute the report and the debug details-
Now the rollback is executing.
Now though the ROLLBACK happens finally, but as the UDPATE happens in the autonomous transaction section where an implicit COMMIT is triggered and the update is persisted.
It could be possible that we can explicitly maintain COMMIT or ROLLBACK in the auto transaction but at the end implicit COMMIT is triggered.