Presentation is loading. Please wait.

Presentation is loading. Please wait.

Em Spatiotemporal Database Laboratory Pusan National University File Processing : Transaction Management 2004, Spring Pusan National University Ki-Joune.

Similar presentations


Presentation on theme: "Em Spatiotemporal Database Laboratory Pusan National University File Processing : Transaction Management 2004, Spring Pusan National University Ki-Joune."— Presentation transcript:

1 em Spatiotemporal Database Laboratory Pusan National University File Processing : Transaction Management 2004, Spring Pusan National University Ki-Joune Li

2 em Spatiotemporal Database Laboratory Pusan National University Basic Concepts of Transaction Transaction A set of operations Atomic :  All or Nothing : Consistent State of Database  Example : Flight Reservation  Cf. Partially Done : Inconsistent State

3 em Spatiotemporal Database Laboratory Pusan National University ACID Properties Atomicity. All or Nothing Not Partially Done Example : Failure in Flight Reservation Consistency. Execution of a transaction preserves the consistency of the database. State 1 State 2 All Nothing State 2’ Partially Done Consistent

4 em Spatiotemporal Database Laboratory Pusan National University Transaction States Active Partially Committed FailedAborted Committed the initial state; the transaction stays in this state while it is executing after the discovery that normal execution can no longer proceed. after the transaction has been rolled back and the database restored to its state prior to the start of the transaction. - restart the transaction or - kill the transaction ALL NOTHING

5 em Spatiotemporal Database Laboratory Pusan National University Relational Operators : Project Isolation. Although multiple transactions may execute concurrently, each transaction must be unaware of other concurrently executing transactions. Intermediate transaction results must be hidden from other concurrently executed transactions. Durability. After a transaction completes successfully, the changes it has made to the database persist, even if there are system failures. DB Transation 1 Transation 2 No Effect

6 em Spatiotemporal Database Laboratory Pusan National University Example Transaction : Transfer $50 from account A to account B: 1.read(A) 2.A := A – 50 3.write(A) 4.read(B) 5.B := B + 50 6.write(B) Consistency requirement the sum of A and B is unchanged after the transaction. Atomicity requirement Durability Isolation

7 em Spatiotemporal Database Laboratory Pusan National University Example : Concurrent Execution Two Transactions T 1 : transfer $50 from A to B, T 2 transfer 10% of the balance from A to B Serial ScheduleConcurrent Schedule

8 em Spatiotemporal Database Laboratory Pusan National University Serializability What happens after these transactions ? Serial Schedule :  Always Correct  T1  T2 and T2  T1 Concurrent Schedule Serializable if Result (T1||T2) = Result(T1  T2) or Result(T2  T1)

9 em Spatiotemporal Database Laboratory Pusan National University Transaction Management Guarantee ACID Properties of Transaction by Concurrency Control : Isolation and Consistency Recovery : Atomicity and Durability


Download ppt "Em Spatiotemporal Database Laboratory Pusan National University File Processing : Transaction Management 2004, Spring Pusan National University Ki-Joune."

Similar presentations


Ads by Google