SlideShare a Scribd company logo
1 of 2
Download to read offline
CSEP 545 Transaction Processing for E-Commerce 2/15/2012
Assignment 6 1
Assignment 6
Problem 1.
Suppose a transaction sets an intention-write lock on a file and later sets a write lock on a
record of the file. Is it safe for the transaction to release the intention-write lock before it
commits? Why?
Problem 2.
The multi-granularity locking protocol requires that if a transaction has a w or iw lock on
a data item x, then it must have an iw lock on x’s parent.
a. Is it correct for a transaction to hold an r lock on x’s parent instead? Either explain
why it’s correct or give an example where it fails.
b. Redo question (a), replacing “r lock” by “w lock”.
c. Assuming the lock graph is a tree, suggest a case where it would be useful to set such
a w lock as in (b) (whether or not it’s correct).
Problem 3.
Consider the following database table, which supports a multiversion concurrency
control.
TID Previous
TID
Account# Balance
1 Null 10 100
3 1 10 200
1 Null 11 300
4 1 11 400
5 4 11 350
6 Null 12 500
Suppose the commit list contains {1,2,3,4,6} and there are no active transactions.
a. What is the state of the table after running the following transaction?:
TID=8: Increment the balance of account 10 by 100;
Delete account 12;
Insert account 13 with balance 700.
b. Suppose a read-only query with TID=7 reads all the accounts. It starts executing
before executing transaction 8 starts executing and finishes after transaction 8
commits (same transaction 8 as part (a)). Which versions of which rows does it read?
CSEP 545 Transaction Processing for E-Commerce 2/15/2012
Assignment 6 2
c. After transactions 7 and 8 have finished and no other transactions are active, suppose
we garbage collect all of the versions that aren’t needed. Assuming transaction ids
increase monotonically with respect time, what does the table look like after the
garbage collection step?
Problem 4.
Suppose file F contains a sequence of fixed-length records, and F’s descriptor includes a
count of the number of records in F, which is used to find the end of F. Consider the
following two transactions:
• T1:
• Scan F, returning all the records in F
• Read(x)
• T2:
• Insert a record into F
• Write(x)
Data item x is not in F. Both transactions are two-phase locked (locking records in F and
x), but neither transaction locks count.
a. Given an example of a non-serializable execution of T1 and T2. Explain why it’s non-
serializable.
b. Explain why this is an example of the phantom problem.

More Related Content

Viewers also liked (9)

20131212 advent calender
20131212 advent calender20131212 advent calender
20131212 advent calender
 
Actividades primaria
Actividades primariaActividades primaria
Actividades primaria
 
Portfolio capi demi-couture by patrizia Rebecchi web
Portfolio capi demi-couture by patrizia Rebecchi webPortfolio capi demi-couture by patrizia Rebecchi web
Portfolio capi demi-couture by patrizia Rebecchi web
 
ритм. гімнаст.2
ритм. гімнаст.2ритм. гімнаст.2
ритм. гімнаст.2
 
Innervación del miembro superior
Innervación del miembro superiorInnervación del miembro superior
Innervación del miembro superior
 
Shell入門
Shell入門Shell入門
Shell入門
 
Epoc tema fisiopatologia
Epoc tema fisiopatologiaEpoc tema fisiopatologia
Epoc tema fisiopatologia
 
Telemedicina. Generalidades y Áreas de Aplicación Clínica
Telemedicina.  Generalidades y Áreas de Aplicación ClínicaTelemedicina.  Generalidades y Áreas de Aplicación Clínica
Telemedicina. Generalidades y Áreas de Aplicación Clínica
 
RailsのRailから解放される始めの一歩
RailsのRailから解放される始めの一歩RailsのRailから解放される始めの一歩
RailsのRailから解放される始めの一歩
 

Similar to Assignment.6.2012

17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMSkoolkampus
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 
transaction management, concept & State
transaction management, concept & Statetransaction management, concept & State
transaction management, concept & StateSurya Swaroop
 
MongoDB.local Sydney: How and When to Use Multi-Document Distributed Transact...
MongoDB.local Sydney: How and When to Use Multi-Document Distributed Transact...MongoDB.local Sydney: How and When to Use Multi-Document Distributed Transact...
MongoDB.local Sydney: How and When to Use Multi-Document Distributed Transact...MongoDB
 
Recovery & Atom city & Log based Recovery
Recovery & Atom city & Log based RecoveryRecovery & Atom city & Log based Recovery
Recovery & Atom city & Log based RecoveryMeghaj Mallick
 
databasehomeworkhelp.com_ Database System Assignment Help (1).pptx
databasehomeworkhelp.com_ Database System Assignment Help (1).pptxdatabasehomeworkhelp.com_ Database System Assignment Help (1).pptx
databasehomeworkhelp.com_ Database System Assignment Help (1).pptxDatabase Homework Help
 
Concurrency Control, Recovery, Case Studies
Concurrency Control, Recovery, Case StudiesConcurrency Control, Recovery, Case Studies
Concurrency Control, Recovery, Case StudiesPrabu U
 
concurrency-control-techniques.ppt
concurrency-control-techniques.pptconcurrency-control-techniques.ppt
concurrency-control-techniques.pptkushvithchinna900
 
DBMS Unit III Material
DBMS Unit III MaterialDBMS Unit III Material
DBMS Unit III MaterialArthyR3
 
Database management system chapter15
Database management system chapter15Database management system chapter15
Database management system chapter15Md. Mahedi Mahfuj
 

Similar to Assignment.6.2012 (20)

Solution6.2012
Solution6.2012Solution6.2012
Solution6.2012
 
Unit06 dbms
Unit06 dbmsUnit06 dbms
Unit06 dbms
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
Ch15
Ch15Ch15
Ch15
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
24904 lecture11
24904 lecture1124904 lecture11
24904 lecture11
 
Assignment.1
Assignment.1Assignment.1
Assignment.1
 
Unit 06 dbms
Unit 06 dbmsUnit 06 dbms
Unit 06 dbms
 
transaction management, concept & State
transaction management, concept & Statetransaction management, concept & State
transaction management, concept & State
 
Operating System Engineering
Operating System EngineeringOperating System Engineering
Operating System Engineering
 
MongoDB.local Sydney: How and When to Use Multi-Document Distributed Transact...
MongoDB.local Sydney: How and When to Use Multi-Document Distributed Transact...MongoDB.local Sydney: How and When to Use Multi-Document Distributed Transact...
MongoDB.local Sydney: How and When to Use Multi-Document Distributed Transact...
 
Recovery & Atom city & Log based Recovery
Recovery & Atom city & Log based RecoveryRecovery & Atom city & Log based Recovery
Recovery & Atom city & Log based Recovery
 
Recovery system
Recovery systemRecovery system
Recovery system
 
databasehomeworkhelp.com_ Database System Assignment Help (1).pptx
databasehomeworkhelp.com_ Database System Assignment Help (1).pptxdatabasehomeworkhelp.com_ Database System Assignment Help (1).pptx
databasehomeworkhelp.com_ Database System Assignment Help (1).pptx
 
Concurrency Control, Recovery, Case Studies
Concurrency Control, Recovery, Case StudiesConcurrency Control, Recovery, Case Studies
Concurrency Control, Recovery, Case Studies
 
concurrency-control-techniques.ppt
concurrency-control-techniques.pptconcurrency-control-techniques.ppt
concurrency-control-techniques.ppt
 
DBMS Unit III Material
DBMS Unit III MaterialDBMS Unit III Material
DBMS Unit III Material
 
Ch15
Ch15Ch15
Ch15
 
Database management system chapter15
Database management system chapter15Database management system chapter15
Database management system chapter15
 
Transaction
TransactionTransaction
Transaction
 

More from ashish61_scs

More from ashish61_scs (20)

7 concurrency controltwo
7 concurrency controltwo7 concurrency controltwo
7 concurrency controltwo
 
Transactions
TransactionsTransactions
Transactions
 
22 levine
22 levine22 levine
22 levine
 
21 domino mohan-1
21 domino mohan-121 domino mohan-1
21 domino mohan-1
 
20 access paths
20 access paths20 access paths
20 access paths
 
19 structured files
19 structured files19 structured files
19 structured files
 
18 philbe replication stanford99
18 philbe replication stanford9918 philbe replication stanford99
18 philbe replication stanford99
 
17 wics99 harkey
17 wics99 harkey17 wics99 harkey
17 wics99 harkey
 
16 greg hope_com_wics
16 greg hope_com_wics16 greg hope_com_wics
16 greg hope_com_wics
 
15 bufferand records
15 bufferand records15 bufferand records
15 bufferand records
 
14 turing wics
14 turing wics14 turing wics
14 turing wics
 
14 scaleabilty wics
14 scaleabilty wics14 scaleabilty wics
14 scaleabilty wics
 
13 tm adv
13 tm adv13 tm adv
13 tm adv
 
11 tm
11 tm11 tm
11 tm
 
10b rm
10b rm10b rm
10b rm
 
10a log
10a log10a log
10a log
 
09 workflow
09 workflow09 workflow
09 workflow
 
08 message and_queues_dieter_gawlick
08 message and_queues_dieter_gawlick08 message and_queues_dieter_gawlick
08 message and_queues_dieter_gawlick
 
06 07 lock
06 07 lock06 07 lock
06 07 lock
 
05 tp mon_orbs
05 tp mon_orbs05 tp mon_orbs
05 tp mon_orbs
 

Recently uploaded

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 

Recently uploaded (20)

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 

Assignment.6.2012

  • 1. CSEP 545 Transaction Processing for E-Commerce 2/15/2012 Assignment 6 1 Assignment 6 Problem 1. Suppose a transaction sets an intention-write lock on a file and later sets a write lock on a record of the file. Is it safe for the transaction to release the intention-write lock before it commits? Why? Problem 2. The multi-granularity locking protocol requires that if a transaction has a w or iw lock on a data item x, then it must have an iw lock on x’s parent. a. Is it correct for a transaction to hold an r lock on x’s parent instead? Either explain why it’s correct or give an example where it fails. b. Redo question (a), replacing “r lock” by “w lock”. c. Assuming the lock graph is a tree, suggest a case where it would be useful to set such a w lock as in (b) (whether or not it’s correct). Problem 3. Consider the following database table, which supports a multiversion concurrency control. TID Previous TID Account# Balance 1 Null 10 100 3 1 10 200 1 Null 11 300 4 1 11 400 5 4 11 350 6 Null 12 500 Suppose the commit list contains {1,2,3,4,6} and there are no active transactions. a. What is the state of the table after running the following transaction?: TID=8: Increment the balance of account 10 by 100; Delete account 12; Insert account 13 with balance 700. b. Suppose a read-only query with TID=7 reads all the accounts. It starts executing before executing transaction 8 starts executing and finishes after transaction 8 commits (same transaction 8 as part (a)). Which versions of which rows does it read?
  • 2. CSEP 545 Transaction Processing for E-Commerce 2/15/2012 Assignment 6 2 c. After transactions 7 and 8 have finished and no other transactions are active, suppose we garbage collect all of the versions that aren’t needed. Assuming transaction ids increase monotonically with respect time, what does the table look like after the garbage collection step? Problem 4. Suppose file F contains a sequence of fixed-length records, and F’s descriptor includes a count of the number of records in F, which is used to find the end of F. Consider the following two transactions: • T1: • Scan F, returning all the records in F • Read(x) • T2: • Insert a record into F • Write(x) Data item x is not in F. Both transactions are two-phase locked (locking records in F and x), but neither transaction locks count. a. Given an example of a non-serializable execution of T1 and T2. Explain why it’s non- serializable. b. Explain why this is an example of the phantom problem.