SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
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.

Contenu connexe

En vedette (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から解放される始めの一歩
 

Similaire à 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
 

Similaire à 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
 
Database management system chapter15
Database management system chapter15Database management system chapter15
Database management system chapter15
 
Ch15
Ch15Ch15
Ch15
 
Transaction
TransactionTransaction
Transaction
 

Plus de ashish61_scs

Plus de 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
 

Dernier

Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 

Dernier (20)

Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 

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.