Enterprise applications let users insert new data or manipulate existing data. In most situations, this data is crucial, so the application must perform data manipulation reliably. This reliability is guaranteed through transactions, the subject of this chapter.
A transaction is defined as a unit of work, a sequence of operations that must be completed all together, that must be performed reliably. Although this is not a comprehensive definition of a transaction, it's sufficient to give us an idea of what transactions aim to provide.
Databases are the main context in which transactions are discussed. In a database, a transaction implies the reliable performance of a unit of persistence operations. As applications interact with databases, these interactions involve transactions, as well. Applications do not need to implement transactions themselves. Instead, they rely on transaction services exposed by the underlying database or by the application server....