In order to understand concurrency, we need to understand the concept of a transaction. A transaction, in database terms, is a discrete unit of work within the database that accomplishes a certain task. Transactions allow groups of statements to be executed together, to allow for correct recovery in the event of failure. Transaction control is the act of manipulating the timing and execution of transactions. Let's begin this section with an example that demonstrates the importance of transaction control.
In database terms, transactions generally involve statements from the SQL sublanguage called Data Manipulation Language (DML). The SELECT
, INSERT
, UPDATE
, and DELETE
statements are generally categorized as DML, although some definitions exclude the SELECT
statements. They also involve statements such as COMMIT
and ROLLBACK
, which are referred to as Transaction Control Language (TCL). In the following example...