O'Reilly logo

Oracle PL/SQL For Dummies by Paul Dorsey, Michael Rosenblum

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12

Transaction Control

In This Chapter

bullet Handling transactions and data consistency

bullet Using commits and rollbacks

bullet Performing autonomous transactions

A transaction is a logical unit of work that comprises a series of SQL data manipulation statements. The COMMIT command permanently saves the changes that all the SQL DML commands (data manipulation — INSERT/ UPDATE/DELETE) made during the current transaction to the database. Conversely, a ROLLBACK command ends the transaction and undoes any changes made.

This ability to commit a set of database events is one of the cornerstones of a professional relational database. Many smaller, PC-based relational database products don’t support this concept of a commit and are therefore unsuitable for real-world applications. Problems occur when something unexpected happens. The unexpected event could be the power going out, the network being interrupted, or even the application raising an unanticipated exception. When this unexpected event occurs, execution stops, and it is possible that only some of your database changes have been saved. How do you know what went into the database and what didn’t? How do you get back to a stable point and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required