which returns the number of employees whose age is 27, and the other contains the single UPDATE statement
The granular locking protocol can exhibit a deadlock between two transactions, one of
which executes a single SELECT statement and the other a single UPDATE statement.
For example, suppose that one transaction contains the single SELECT statement
SELECT COUNT (P.Id)
FROM Employee P
WHERE P.Age = ’27’
UPDATE Employee
SET Salary = Salary * 1.1
WHERE Department = ’Adm’
which gives all employees in the administration a 10% raise. Assume that there
are indices on both Department and Age and that the tuples corresponding to the
department Adm are stored in more than one page as are those corresponding to age 27.
Showhowa deadlock might occur at isolation levels other than READ UNCOMMITTED.
At isolation levels SERIALIZABLE, REPEATABLE READ, and READ COMMITTED, the
first transaction, T1, gets an IS lock on the table and an S lock on the first page
containing tuples corresponding to Age 27. Meanwhile, the second transaction, T2,
gets an IX lock on the table and an X lock on the first page containing tuples
corresponding to the Administration Department. If the Department has 27 year old employees, it might be the case that later T1 requests an S lock on a page T2 has locked, and T2 requests an X lock on a page T1 has locked. A deadlock occurs.
At isolation level READ UNCOMMITTED transactions do not get read locks.
However, since each statement must execute in an isolated fashion, internal locks
on the same items must be acquired by T1 and held until the statement has been
completely processed. Therefore the deadlock could still occur.
You might also like to view...
A ________ determines whether a field contains an integer value in an acceptable range.
a. f:validateDoubleRange. b. f:validateLength. c. f:validateLongRange. d. None of the above.
On disk, data are recorded on concentric circles called __________.
a. blocks b. sectors c. tracks d. cylinders
What are the benefits of fiber-optic cabling?
What will be an ideal response?
What Windows tool is best to see whether a FireWire host controller is present?
a. Disk Management b. Services and Applications c. Performance Manager d. Device Manager