Database Reference
In-Depth Information
Consistency This property of a transaction preserves database consistency.
If a transaction executes successfully and performs its database updates properly,
the database is transformed from one consistent state to another consistent
state.
Preservation of database consistency also results from the other three properties
of a transaction.
Isolation For the user, a transaction must appear as though it executed by itself
without interference from any other concurrent transaction. In practice, however,
many concurrent database transactions execute simultaneously. For performance
reasons, operations of one transaction are interleaved with operations of other
transactions. However, the database system must guarantee the effects of database
updates for every pair of concurrent transactions to be as though one transaction
executed from beginning to end and then the second started, or vice versa. Trans-
actions must execute independently, and intermediary or partial results of incom-
plete transactions must be transparent to other transactions.
The concurrency control component of the DBMS handles isolation.
Durability The effects of database updates by successfully completed transactions
must be permanent in the database. Even if and when there are subsequent
failures, the effects must persist in the database.
The recovery management component of the DBMS handles durability.
Let us revisit the example of the transfer of funds from savings to checking
accounts. Look at Figures 15-1 and 15-2 again. If you name the transaction T1, then
the coding shown below may represent the transaction:
T1:
BEGIN
READ ( savings );
savings := savings - 50000;
WRITE ( savings );
READ ( checking );
checking := checking + 50000;
WRITE ( checking );
COMMIT
Walk through the ACID requirements for transaction T1 and note how database
integrity is preserved.
Atomicity. As shown in Figures 15-1 and 15-2, the initial values of savings and check-
ing before T1 started are 440000 and 10000, respectively. Figure 15-1, which presents
the successful completion of T1, represents the case in which all database updates
are performed and the transaction is executed in its entirety. Figure 15-2 presents a
database failure after WRITE ( savings ) operation. In this case, the transaction man-
agement component ensures atomicity by removing the effect of WRITE ( savings ).
The effects of all operations of a transaction are left in the database or none at all.
This is the requirement of the property of atomicity.
Search WWH ::




Custom Search