An autonomous transaction is a type of transaction used in the Oracle® line of database software programs. In the simplest sense of the term, an autonomous transaction is a transaction which occurs and completes as part of another transaction. During autonomous transactions, the computer software pauses its processing of the original transaction, branching off to retrieve the information or complete the process required by the autonomous transaction. Once it has obtained a result for the autonomous transaction, it picks up exactly where it left off in processing the original transaction.
Autonomous transactions are typically used when a database operator wants to break a more complex transaction into its component parts. For example, if the database operator wants to produce of a list of all employees who make more than $60,000 US Dollars (USD) a year and then wishes to subdivide that list into only the employees under 30 years of age, using an autonomous transaction would allow the operator to split the request into two parts. First, the computer will being gathering a list of all employees who make $60,000 USD. In the midst of this operation, it will resolve the second part of the request to complete the autonomous transaction, selecting only those employees from the $60,000 USD or more list who are also under 30 years of age.
One major advantage to autonomous transactions is that they provide greater simplicity when calling database operations. In breaking things down into their component parts, it can become easier for a database operator to visualize each step in the process, easing the process of coding the actual request. A second advantage to autonomous transactions is that they can be nested within each other; a skilled database operator can program a transaction which calls an autonomous transaction where the autonomous transaction then calls any number of additional autonomous transactions. This drastically improves the flexibility of the Oracle database transaction software, allowing more complex transactions to be coded with ease.
Each transaction which occurs in the program is tracked by the software itself for auditing purposes. This allows individuals to review the transactions that have been requested from the database. Writing transactions in autonomous form can help to simplify the auditing procedure, as it is far easier to make sense of a number of sequential simple transactions than a single complex statement.