Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Assume transaction A holds a shared lock R. I... Start Learning for Free
Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will,
  • a)
    Result in a deadlock situation
  • b)
    Immediately be granted
  • c)
    Immediately be rejected
  • d)
    Be granted as soon as it is released by A
Correct answer is option 'B'. Can you explain this answer?
Verified Answer
Assume transaction A holds a shared lock R. If transaction B also requ...
Concept:
Simple locking scheme:
1. Shared lock (S)
2. Exclusive lock (X)
Shared Lock (S): If transaction locked data item in shared mode, allowed to read only.
Exclusive Lock (X): If transaction locked data item in shared mode, allowed to read and write both.
Explanation: 
From above table we can see that if one transaction has shared lock on a data item and if one other transaction request for shared lock on the same data item it will be immediately granted.    
You can know more about Transactions & Concurrency Control through the document:            
View all questions of this test
Most Upvoted Answer
Assume transaction A holds a shared lock R. If transaction B also requ...
Explanation:

When a transaction A holds a shared lock on a resource R, it means that it has read access to the resource and other transactions can also have shared locks on the same resource for read access. In this scenario, if transaction B also requests for a shared lock on R, the following can happen:

1. Immediate Grant:
If there are no conflicting locks held by other transactions on the resource R, then transaction B will be immediately granted the shared lock. This is because shared locks do not conflict with each other and multiple transactions can hold shared locks on the same resource.

2. Wait:
If there is a conflicting lock held by another transaction on resource R, then transaction B will have to wait until the conflicting lock is released. If the conflicting lock is an exclusive lock, then transaction B will have to wait until the lock is released by the transaction holding it. If the conflicting lock is a shared lock held by another transaction, then transaction B can be granted the shared lock immediately after the other transaction releases it.

3. Rejection:
If transaction A holds an exclusive lock on the resource R, then transaction B will be rejected because exclusive locks cannot be granted to multiple transactions simultaneously.

Conclusion:

Therefore, it can be concluded that if transaction A holds a shared lock on a resource R, and transaction B also requests for a shared lock on R, it will be immediately granted if there are no conflicting locks held by other transactions on the resource R.
Free Test
Community Answer
Assume transaction A holds a shared lock R. If transaction B also requ...
Since transaction A holds only a shared lock R.
Hence any number of transaction can read the data from the requested item using shared locking. Hence B’s request will be granted immediately Hence option (b) is correct.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will,a)Result in a deadlock situationb)Immediately be grantedc)Immediately be rejectedd)Be granted as soon as it is released by ACorrect answer is option 'B'. Can you explain this answer?
Question Description
Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will,a)Result in a deadlock situationb)Immediately be grantedc)Immediately be rejectedd)Be granted as soon as it is released by ACorrect answer is option 'B'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will,a)Result in a deadlock situationb)Immediately be grantedc)Immediately be rejectedd)Be granted as soon as it is released by ACorrect answer is option 'B'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will,a)Result in a deadlock situationb)Immediately be grantedc)Immediately be rejectedd)Be granted as soon as it is released by ACorrect answer is option 'B'. Can you explain this answer?.
Solutions for Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will,a)Result in a deadlock situationb)Immediately be grantedc)Immediately be rejectedd)Be granted as soon as it is released by ACorrect answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will,a)Result in a deadlock situationb)Immediately be grantedc)Immediately be rejectedd)Be granted as soon as it is released by ACorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will,a)Result in a deadlock situationb)Immediately be grantedc)Immediately be rejectedd)Be granted as soon as it is released by ACorrect answer is option 'B'. Can you explain this answer?, a detailed solution for Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will,a)Result in a deadlock situationb)Immediately be grantedc)Immediately be rejectedd)Be granted as soon as it is released by ACorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will,a)Result in a deadlock situationb)Immediately be grantedc)Immediately be rejectedd)Be granted as soon as it is released by ACorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will,a)Result in a deadlock situationb)Immediately be grantedc)Immediately be rejectedd)Be granted as soon as it is released by ACorrect answer is option 'B'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev