A transaction is a logical unit of work that comprises one or more SQL statements executed by a single user. According to the ANSI/ISO SQL standard, with which Oracle is compatible, a transaction begins with the user’s first executable SQL statement. A transaction ends when it is explicitly committed or rolled back (both terms are discussed later in this section) by that user.
Consider a banking database. When a bank customer transfers money from a savings account to a checking account, the transaction might consist of three separate operations: decrease the savings account, increase the checking account, and record the transaction in the transaction journal.
Oracle must guarantee that all three SQL statements are performed to maintain the accounts in proper balance. When something prevents one of the statements in the transaction from executing (such as a hardware failure), the other statements of the transaction must be undone; this is called "rolling back." If an error occurs in making either of the updates, then neither update is made.
(en dat Oracle kun je natuurlijk vervangen door elke willekeurige db die aan transactions doet)
Transactions zorgen er dus voor dat een aantal SQL statements
of allemaal goed worden uitgevoerd,
of allemaal niet.
(trouwens Arjen,
volgens de MySQL manual support MySQL wél BEGIN, COMMIT en ROLLBACK)