Database Reference
In-Depth Information
record for data warehousing textbook; in the second case, both transactions need
to read and update the inventory record for database textbook.
Note the two cases carefully. In both cases, transactions T1 and T2 execute simul-
taneously. Observe the second case and see why this case gives rise to a potential
problem. In the second case, both transactions need to read and update the same
record, namely, the inventory record of database textbook. Instead of allowing
transactions T1 and T2 to execute concurrently, let the system allow transaction T1
to execute independently first from beginning to end and then start transaction T2
and allow T2 also to execute from beginning to end. If this is done, you will not have
an integrity problem even though both transactions read and update the same
record.
Motivation for Concurrency
The question naturally arises: Why not execute transactions sequentially and avoid
potential integrity problems? Note that in the above two cases, because the two
transactions are permitted to execute concurrently, the read and write operations
within the two transactions can be interleaved. How does this help? Does not this
interleaving of operations cause integrity problems? Let us examine possible
reasons for allowing transactions to execute concurrently.
Remember that a database system is a transaction-processing environment and
any method to speed up the overall processing is highly welcome in such an envi-
ronment. A database system exists to support the processing of transactions—every
effort to accelerate transaction processing deserves top priority.
A transaction consists of CPU processing and I/O operations. While one trans-
action waits for I/O, CPU can process another transaction. In this manner, paral-
lelism of the overall process can be achieved. You have noted this type of parallelism
in the above example. This is the primary motivation for concurrent transactions.
Here is a list of major benefits of transaction concurrency:
Overall increase in system throughput
Reduced response times
Simultaneous sharing of data
Executing a short transaction and a long transaction concurrently allows the
shorter transaction to finish quickly without waiting for the longer transaction
to end
Avoids unpredictable delays in response times
Concurrency Problems
Perhaps you are now ready to accept that there are potential benefits of allowing
the concurrent processing of transactions. Especially in a large transaction-
processing environment and in an environment with long-running transactions,
concurrent transaction processing seems to be inevitable.
You are already aware of potential integrity problems when two or more
concurrent transactions seek to read and write the same database item. In this
case, we say that the two concurrent transactions are in conflict. Two operations on
Search WWH ::




Custom Search