When to Use Autonomous Transactions

Where would you find autonomous transactions useful in your applications? First, let's reinforce the general principle: you will want to define your program module as an autonomous transaction whenever you want to isolate the changes made in that module from the caller's transaction context.

Here are some specific ideas:

Before we take a look at how you might use autonomous transactions for these scenarios, let's get a clearer picture about what you can and cannot do with autonomous transactions.

Another Tool in the Toolbox

As Oracle database technology matures and broadens, we can sometimes (often?) feel overwhelmed by all of its features, its opportunities, and its increasing sophistication and complexity. How can we keep up with it all? Well, perhaps we don't have to keep up with it all. Perhaps we can take a different approach: develop a basic familiarity with the latest and greatest stuff.

Recognize this feature or that as just another potential tool you can use to implement your applications. Learn to distill out from the technobabble of daily life the core advantages of a feature. Then, when you encounter a particular requirement, you can evaluate which of all these tools can best be applied to come up with an optimal solution.

Autonomous transactions are not going to be useful or applicable in every one (or even very many) of your programs. The autonomous transaction feature is, however, a very handy new tool in the PL/SQL developer's toolbox. Keep it in mind, and pull it out as needed.