SlideShare ist ein Scribd-Unternehmen logo
1 von 12
3. Acid Property of Transactions
Transactions should possess several properties. These are often
called the acid properties, and they should be enforced by the
concurrency control and recovery methods of the DBMS.
♩ Acid properties:
â–Ș Atomicity:
Transaction is an atomic unit of processing; Performed entirety or not.

â–Ș Consistency preservation:
â–Ș Isolation:
Execution of a transaction should not be interfered with other transactions.

â–Ș Durability or permanency:
The changes applied to the database by a committed transaction must persist
in the database.
3. Acid Property of Transactions
â–Ș Atomicity:
Consider the case of funds transfer from account a to account b.
A.bal -= amount;
B.bal += amount;
A.bal -= amount;
Crash




Recovery
A.bal += amount;
ï‚ź rollback

Within the scope of a transaction
- all changes occur together or no changes occur
- atomicity is the responsibility of the transaction manager
Ex) a money transfer, debit removes funds, credit add funds, no funds are lost!
3. Acid Property of Transactions
â–Ș Consistency preservation:
‱ Consider the case of funds transfer from account a to account b.
A.bal -= amount;
B.bal += amount;
A.bal -= amount;
B.bal += amount(fails!! A’s balance is 0)
A.bal += amount;
ï‚ź rollback
‱ Transactions scope a set of operations
- consistency can be violated within a transaction
- transaction must be correct according to application rules
- begin and commit are points of consistency
- consistency preservation is a property of a transaction, not of the tp system.
3. Acid Property of Transactions
â–Ș Isolation :
‱ Consider the case of funds transfer from account a to account b.
Transaction t1:
A.bal -= amount; (let a’s balance become 0 after this
)
B.bal += amount;
Transaction t2:
A.bal -= amount2;
Net effect should be either t1,t2 (in which case t2 fails) or
t2,t1 (in which case t1 fails).
3. Acid Property of Transactions
â–Ș Durability :
‱ Consider the case of funds transfer from account a to account b.
Account a should have a balance of amount
Transaction t1:
A.bal -= amount;
B.bal += amount;
Commit
Account a should have a balance of 0.
‱ When a transaction commits, its results must survive failures
– must be durably recorded prior to commit
– system waits for disk ask before asking to user
‱ If a transaction rolls back, changes must be undone
– before images recorded
– undo processing after failure
4. Transaction States
◆ Transaction States
Active: initial state; when the transaction is executing
Partially committed: when the last statement has finished execution
Failed: on discovery that normal execution can no longer proceed
Aborted: after the rollback is performed from a failed transaction
Committed: after successful completion
Terminated: either committed or aborted
4. Transaction States
◆ Transaction Execution
A transaction reaches its commit point when all operations accessing the
database are completed and the result has been recorded in the log. It
then writes a [commit, transaction-id].

If a system failure occurs, searching the log and rollback the transactions
that have written into the log a
[start_transaction, transaction-id]
[write_item, transaction-id, x, old_value, new_value]
But have not recorded into the log a [commit, transaction-id]
4. Transaction States
◆ Transaction states and additional operations
For recovery purposes, the system needs to keep track of when the transaction
starts, terminates, and commits or aborts (see below).
Hence, the recovery manager keeps track of the following operations:
Begin transaction:
End transaction:
Commit transaction:
Rollback (or abort):
4. Transaction States
◆ Acid using shadow copy
‱ Assume that only one transaction is active at a time.
‱ db pointer always points to the current consistent copy of
the database.
‱ All updates are made on a shadow copy of the database, and
db pointer is made to point to the updated shadow copy only
after the transaction reaches partial commit and all updated
pages have been flushed to disk.
‱ In case transaction fails, old consistent copy pointed to by
db pointer can be used, and the shadow copy can be deleted.
‱ Simple but extremely inefficient implementation
‱ Assumes database to be a file.
4. Transaction States
◆ The shadow-database scheme

This assumes disks do not fail. It is useful for text editors, but extremely
inefficient for large databases and does not handle concurrent
transactions.
4. Transaction States
◆ Transaction as a Concurrency Unit
Transactions must be synchronized for database consistency.
4. Transaction States
◆ Concurrent executions
Multiple transactions are allowed to run concurrently.

Advantages are:
Increased processor and disk utilization
Reduced average response time for transactions
Concurrency control schemes

Weitere Àhnliche Inhalte

Andere mochten auch

Dbms ii mca-ch9-transaction-processing-2013
Dbms ii mca-ch9-transaction-processing-2013Dbms ii mca-ch9-transaction-processing-2013
Dbms ii mca-ch9-transaction-processing-2013Prosanta Ghosh
 
OS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and MonitorsOS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and Monitorssgpraju
 
Primary and secondary needs
Primary and secondary needsPrimary and secondary needs
Primary and secondary needsAraullo University
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating SystemsRitu Ranjan Shrivastwa
 
deadlock prevention
deadlock preventiondeadlock prevention
deadlock preventionNilu Desai
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactionsNilu Desai
 
Distributed databases,types of database
Distributed databases,types of databaseDistributed databases,types of database
Distributed databases,types of databaseBoomadevi Shanmugam
 
Transaction Management
Transaction Management Transaction Management
Transaction Management Visakh V
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMSMegha Patel
 
Chapter 5 Database Transaction Management
Chapter 5 Database Transaction ManagementChapter 5 Database Transaction Management
Chapter 5 Database Transaction ManagementEddyzulham Mahluzydde
 
Transaction management
Transaction managementTransaction management
Transaction managementrenuka_a
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMSkoolkampus
 

Andere mochten auch (16)

Dbms ii mca-ch9-transaction-processing-2013
Dbms ii mca-ch9-transaction-processing-2013Dbms ii mca-ch9-transaction-processing-2013
Dbms ii mca-ch9-transaction-processing-2013
 
Dbms acid
Dbms acidDbms acid
Dbms acid
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
OS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and MonitorsOS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and Monitors
 
Primary and secondary needs
Primary and secondary needsPrimary and secondary needs
Primary and secondary needs
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
deadlock prevention
deadlock preventiondeadlock prevention
deadlock prevention
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactions
 
Distributed databases,types of database
Distributed databases,types of databaseDistributed databases,types of database
Distributed databases,types of database
 
Transaction Management
Transaction Management Transaction Management
Transaction Management
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
 
Chapter 5 Database Transaction Management
Chapter 5 Database Transaction ManagementChapter 5 Database Transaction Management
Chapter 5 Database Transaction Management
 
Transaction management
Transaction managementTransaction management
Transaction management
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
 

Ähnlich wie 3 transaction

Transaction management and concurrency
Transaction management and concurrencyTransaction management and concurrency
Transaction management and concurrencyVenkata Sreeram
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptAdemeCheklie
 
7. transaction mang
7. transaction mang7. transaction mang
7. transaction mangkhoahuy82
 
Chapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlChapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlAbDul ThaYyal
 
Transaction Properties(ACID Properties)
Transaction Properties(ACID Properties)Transaction Properties(ACID Properties)
Transaction Properties(ACID Properties)Yaksh Jethva
 
FALLSEM2023-24_BCSE302L_TH_VL2023240100957_2023-06-21_Reference-Material-I.pptx
FALLSEM2023-24_BCSE302L_TH_VL2023240100957_2023-06-21_Reference-Material-I.pptxFALLSEM2023-24_BCSE302L_TH_VL2023240100957_2023-06-21_Reference-Material-I.pptx
FALLSEM2023-24_BCSE302L_TH_VL2023240100957_2023-06-21_Reference-Material-I.pptxhritikraj888
 
Unit 4 dbms
Unit 4 dbmsUnit 4 dbms
Unit 4 dbmsSweta Singh
 
transaction_processing.ppt
transaction_processing.ppttransaction_processing.ppt
transaction_processing.pptNikhilKumarAgarwalK
 
Transaction Processing Concept
Transaction Processing ConceptTransaction Processing Concept
Transaction Processing ConceptNishant Munjal
 
Unit iv -Transactions
Unit iv -TransactionsUnit iv -Transactions
Unit iv -TransactionsDhivyaa C.R
 
What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...Raj vardhan
 
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptxUnit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptxKoteswari Kasireddy
 
TRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERY
TRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERYTRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERY
TRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERYRohit Kumar
 
Transactionsmanagement
TransactionsmanagementTransactionsmanagement
TransactionsmanagementSanjeev Gupta
 
DBMS Vardhaman.pdf
DBMS Vardhaman.pdfDBMS Vardhaman.pdf
DBMS Vardhaman.pdfNithishReddy90
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency ControlRavimuthurajan
 

Ähnlich wie 3 transaction (20)

Transaction management and concurrency
Transaction management and concurrencyTransaction management and concurrency
Transaction management and concurrency
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.ppt
 
7. transaction mang
7. transaction mang7. transaction mang
7. transaction mang
 
Chapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlChapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency control
 
ch-5 advanced db.pdf
ch-5 advanced db.pdfch-5 advanced db.pdf
ch-5 advanced db.pdf
 
Transaction Processing in DBMS.pptx
Transaction Processing in DBMS.pptxTransaction Processing in DBMS.pptx
Transaction Processing in DBMS.pptx
 
Transaction Properties(ACID Properties)
Transaction Properties(ACID Properties)Transaction Properties(ACID Properties)
Transaction Properties(ACID Properties)
 
19.TRANSACTIONs.ppt
19.TRANSACTIONs.ppt19.TRANSACTIONs.ppt
19.TRANSACTIONs.ppt
 
FALLSEM2023-24_BCSE302L_TH_VL2023240100957_2023-06-21_Reference-Material-I.pptx
FALLSEM2023-24_BCSE302L_TH_VL2023240100957_2023-06-21_Reference-Material-I.pptxFALLSEM2023-24_BCSE302L_TH_VL2023240100957_2023-06-21_Reference-Material-I.pptx
FALLSEM2023-24_BCSE302L_TH_VL2023240100957_2023-06-21_Reference-Material-I.pptx
 
Unit 4 dbms
Unit 4 dbmsUnit 4 dbms
Unit 4 dbms
 
transaction_processing.ppt
transaction_processing.ppttransaction_processing.ppt
transaction_processing.ppt
 
Transaction Processing Concept
Transaction Processing ConceptTransaction Processing Concept
Transaction Processing Concept
 
Lec08
Lec08Lec08
Lec08
 
Unit iv -Transactions
Unit iv -TransactionsUnit iv -Transactions
Unit iv -Transactions
 
What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...
 
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptxUnit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
 
TRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERY
TRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERYTRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERY
TRANSACTION MANAGEMENT AND TIME STAMP PROTOCOLS AND BACKUP RECOVERY
 
Transactionsmanagement
TransactionsmanagementTransactionsmanagement
Transactionsmanagement
 
DBMS Vardhaman.pdf
DBMS Vardhaman.pdfDBMS Vardhaman.pdf
DBMS Vardhaman.pdf
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency Control
 

Mehr von Mr Patrick NIYISHAKA (20)

Summary
SummarySummary
Summary
 
3 summary
3 summary3 summary
3 summary
 
2 ddb architecture
2 ddb architecture2 ddb architecture
2 ddb architecture
 
1 ddb
1 ddb1 ddb
1 ddb
 
2 countermeasures
2 countermeasures2 countermeasures
2 countermeasures
 
2 countermeasures
2 countermeasures2 countermeasures
2 countermeasures
 
3 summary
3 summary3 summary
3 summary
 
1 db security
1 db security1 db security
1 db security
 
4 summary
4 summary4 summary
4 summary
 
3 summary
3 summary3 summary
3 summary
 
2 con control
2 con control2 con control
2 con control
 
1 con exe
1 con exe1 con exe
1 con exe
 
1 basic concepts
1 basic concepts1 basic concepts
1 basic concepts
 
2 recovery
2 recovery2 recovery
2 recovery
 
3 summary
3 summary3 summary
3 summary
 
1 query processing
1 query processing1 query processing
1 query processing
 
1 query processing
1 query processing1 query processing
1 query processing
 
2 optimization
2 optimization2 optimization
2 optimization
 
2 collision
2 collision2 collision
2 collision
 
4 summary
4 summary4 summary
4 summary
 

KĂŒrzlich hochgeladen

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)lakshayb543
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
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
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
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
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 

KĂŒrzlich hochgeladen (20)

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
Visit to a blind student's school🧑‍🩯🧑‍🩯(community medicine)
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.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
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
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...
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 

3 transaction

  • 1. 3. Acid Property of Transactions Transactions should possess several properties. These are often called the acid properties, and they should be enforced by the concurrency control and recovery methods of the DBMS. ♩ Acid properties: â–Ș Atomicity: Transaction is an atomic unit of processing; Performed entirety or not. â–Ș Consistency preservation: â–Ș Isolation: Execution of a transaction should not be interfered with other transactions. â–Ș Durability or permanency: The changes applied to the database by a committed transaction must persist in the database.
  • 2. 3. Acid Property of Transactions â–Ș Atomicity: Consider the case of funds transfer from account a to account b. A.bal -= amount; B.bal += amount; A.bal -= amount; Crash 
 
 Recovery A.bal += amount; ï‚ź rollback Within the scope of a transaction - all changes occur together or no changes occur - atomicity is the responsibility of the transaction manager Ex) a money transfer, debit removes funds, credit add funds, no funds are lost!
  • 3. 3. Acid Property of Transactions â–Ș Consistency preservation: ‱ Consider the case of funds transfer from account a to account b. A.bal -= amount; B.bal += amount; A.bal -= amount; B.bal += amount(fails!! A’s balance is 0) A.bal += amount; ï‚ź rollback ‱ Transactions scope a set of operations - consistency can be violated within a transaction - transaction must be correct according to application rules - begin and commit are points of consistency - consistency preservation is a property of a transaction, not of the tp system.
  • 4. 3. Acid Property of Transactions â–Ș Isolation : ‱ Consider the case of funds transfer from account a to account b. Transaction t1: A.bal -= amount; (let a’s balance become 0 after this
) B.bal += amount; Transaction t2: A.bal -= amount2; Net effect should be either t1,t2 (in which case t2 fails) or t2,t1 (in which case t1 fails).
  • 5. 3. Acid Property of Transactions â–Ș Durability : ‱ Consider the case of funds transfer from account a to account b. Account a should have a balance of amount Transaction t1: A.bal -= amount; B.bal += amount; Commit Account a should have a balance of 0. ‱ When a transaction commits, its results must survive failures – must be durably recorded prior to commit – system waits for disk ask before asking to user ‱ If a transaction rolls back, changes must be undone – before images recorded – undo processing after failure
  • 6. 4. Transaction States ◆ Transaction States Active: initial state; when the transaction is executing Partially committed: when the last statement has finished execution Failed: on discovery that normal execution can no longer proceed Aborted: after the rollback is performed from a failed transaction Committed: after successful completion Terminated: either committed or aborted
  • 7. 4. Transaction States ◆ Transaction Execution A transaction reaches its commit point when all operations accessing the database are completed and the result has been recorded in the log. It then writes a [commit, transaction-id]. If a system failure occurs, searching the log and rollback the transactions that have written into the log a [start_transaction, transaction-id] [write_item, transaction-id, x, old_value, new_value] But have not recorded into the log a [commit, transaction-id]
  • 8. 4. Transaction States ◆ Transaction states and additional operations For recovery purposes, the system needs to keep track of when the transaction starts, terminates, and commits or aborts (see below). Hence, the recovery manager keeps track of the following operations: Begin transaction: End transaction: Commit transaction: Rollback (or abort):
  • 9. 4. Transaction States ◆ Acid using shadow copy ‱ Assume that only one transaction is active at a time. ‱ db pointer always points to the current consistent copy of the database. ‱ All updates are made on a shadow copy of the database, and db pointer is made to point to the updated shadow copy only after the transaction reaches partial commit and all updated pages have been flushed to disk. ‱ In case transaction fails, old consistent copy pointed to by db pointer can be used, and the shadow copy can be deleted. ‱ Simple but extremely inefficient implementation ‱ Assumes database to be a file.
  • 10. 4. Transaction States ◆ The shadow-database scheme This assumes disks do not fail. It is useful for text editors, but extremely inefficient for large databases and does not handle concurrent transactions.
  • 11. 4. Transaction States ◆ Transaction as a Concurrency Unit Transactions must be synchronized for database consistency.
  • 12. 4. Transaction States ◆ Concurrent executions Multiple transactions are allowed to run concurrently. Advantages are: Increased processor and disk utilization Reduced average response time for transactions Concurrency control schemes