Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

Exclusive lock

  • It is asked for by a transaction on a data item that it wants to update.
  • No other transaction can put either a shared lock or an exclusive lock on a data item that is locked in an exclusive mode.

Let us explain the above two modes with the help of an instance. We will once again consider the transactions T1 and T2 but in addition a transaction T11 that search the total of accounts Y and Z.

Schedule

T1

T2

T11

S_Lock X

 

S_Lock X

 

S_Lock Y

 

S_Lock Y

 

Read X

 

Read X

 

S_Lock Y

 

 

S_Lock Y

S_Lock Z

 

 

S_Lock Z

 

 

 

Read Y

 

 

 

Read Z

X_Lock X

X_Lock X. The exclusive lock request on X is denied as T2 holds the Read lock. The transaction T1 Waits.

Read Y

 

Read Y

 

Display X+Y

 

Display X+Y

 

Unlock X

 

Unlock X

 

X_Lock Y

X_Lock Y. The previous exclusive lock request on X is granted as X is unlocked. But the new exclusive lock request on Y is not granted as Y is locked by T2 and T11 in read mode. Thus T1 waits till both T2 and T11 will release the read lock on Y.

Display Y+Z

 

 

Display Y+Z

Unlock Y

 

Unlock Y

 

Unlock Y

 

 

Unlock Y

Unlock Z

 

 

Unlock Z

Read X

Read X

 

 

Subtract 100

Subtract 100

 

 

Write X

Write X

 

 

Read Y

Read Y

 

 

Add 100

Add 100

 

 

Write Y

Write Y

 

 

Unlock X

Unlock X

 

 

Unlock Y

Unlock Y

 

 

                                                               Figure: Example of Locking in multiple-modes

Therefore, the locking as above results in a serialisable schedule. Now the query is can we release locks a bit early and have still no concurrency related problem?Yes, we can do it if we lock using two-phase locking protocol.

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M9527793

Have any Question?


Related Questions in DBMS

Suppose that we have a table of house prices and a table of

Suppose that we have a table of house prices and a table of zip codes: • hprices(hid (PK),address,bedrooms,price,zipcode) • zipcodes(zipcode (PK),state) Write a SQL query that finds the average, maximum, and minimum pric ...

Question 1 what isdata-manipulation language dml there are

Question: 1. What isData-Manipulation Language (DML)? There are four types of access in DML, explain each one. 2. Assume we have a Library Database consists of the following relations: author(author_id, first_name, last_ ...

Analytic reportpurpose the purpose of this task is to

Analytic Report: Purpose: The purpose of this task is to provide students with practical experience in working in teams to write a Data Analytical report to provide useful insights, pattern and trends in the chosen/given ...

Your taskyou have been commissioned to develop a database

Your task You have been commissioned to develop a database system that is capable of keeping records for FU's table tennis matches from now on. The database needs to keep a record of: - All team information, including pl ...

The case study company received a detailed report from the

The case study company received a detailed report from the ECM consultant with a detailed list of data requirements, tools, and processes that are currently used to manage this data. The chief executive officer (CEO) and ...

Question create an erd for the following scenario once you

Question: Create an ERD for the following scenario. Once you submit you will get access to the correct way to create the ERD. Please watch the video and correct any errors in your submission and resubmit. A small company ...

Assignment question - write and run sql statements to

Assignment Question - Write and run SQL statements to complete the following tasks Part A - DML 1. Locate the record in the vendor table that does not have a value for the attribute V_STATE 2. Find the customers whose ba ...

Football association of zambia faz super leaguethe faz has

Football Association of Zambia (FAZ) Super League The FAZ has recently decided to reorganise their operations to support both existing and possibly expanded league operations in Zambia and part of preparation for the 201 ...

Question find at least two academic sources that describe

Question: Find at least two academic sources that describe the movement of Enterprise resource planning (ERP) activities to the cloud. Discuss the types of ERP activities that can be conducted in the cloud and the pros a ...

Stored procedure please create the following stored

Stored procedure. Please create the following stored routines using CPS3740_2017S database using the tables in dreamhome database. xxxx is your email id 1) Implement a stored procedure p3Q21_xxxx to display the Branch ci ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As