Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
10
Transaction Management and Concurrency Control
Homework Assignment -- Problems 1-4, page 442
April 25-May 1
1. Suppose that you are a manufacturer of product ABC, which is composed of parts A, B, and C. Each
time a new product is created, it must be added to the product inventory, using the PROD_QOH in
a table named PRODUCT. And each time the product ABC is created, the parts inventory, using
PART_QOH in a table named PART, must be reduced by one each of parts A, B, and C. The sample
database contents are shown in the following tables
a. How many database requests can you identify for an inventory update for both PRODUCT and
PART?
There are 4 or 2 database requests for inventory update for both PRODUCT and PART.
PART_CODE = ‘C’
UPDATE PART
UPDATE PART
PART_CODE = ‘B’ OR
UPDATE PART
COMMIT;
TRANSACTION
e. Using the transaction log you created in Step d, trace its use in database recovery.
2. Describe the three most common concurrent transaction execution problems. Explain how
concurrency control can be used to avoid those problems.
The three main concurrency control problems are triggered by lost updates, uncommitted data, and
inconsistent retrievals. Concurrency control can be used to avoid these execution problems by
ensuring the serializability of transactions in a multiuser database environment. Concurrency
ensures integrity and prevent inconsistencies that can arise within a database.
3. What DBMS component is responsible for concurrency control? How is this feature used to
resolve conflicts?
Severe database integrity and consistency problems can arise when two or more concurrent
transactions are executed. In order to avoid such problems, the DBMS must exercise concurrency
control. The DBMS's component in charge of concurrency control is the scheduler. To prevent
conflicts the scheduler works on a first come first served basis within the DBMS. In addition, the
scheduler is used to resolve conflicts by facilitating data isolation to ensure that two transactions do
not update the same data element.
4. Using a simple example, explain the use of binary and shared/exclusive locks in a DBMS.
According to our book binary locks can either be locked or unlocked. When a transaction is locked
no other object can use the transaction; however, if the object is unlocked any transaction can lock
the object for its use. For example, in our book in table 10.12, PRODUCT appears to be locked;
therefore, PROD_QOH cannot use this object until it is unlocked. Since PRODUCT is locked, this
object only has READ access. In order for PROD_QOH to unlock and be able to use PRODUCT a
WRITE statement MUST be completed.