Presentation is loading. Please wait.

Presentation is loading. Please wait.

02/23/2005Yan Huang - CSCI5330 Database Implementation – Transaction Transaction I.

Similar presentations


Presentation on theme: "02/23/2005Yan Huang - CSCI5330 Database Implementation – Transaction Transaction I."— Presentation transcript:

1 02/23/2005Yan Huang - CSCI5330 Database Implementation – Transaction Transaction I

2 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Outline Transaction and OLTP Designed properties of transactions

3 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Transaction A multi-billion dollar business OLTP http://www.tpc.org/default.asp

4 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Transaction Definition A unit of program execution that accesses and possibly updates various data items Transactions?  Book an airline ticket from DFW to Paris  Buy “The Dilbert Principle” from amazon.com  Sell 1000 shares of LU from your ameritrade account  Withdraw $100 from a ATM machine  Issue a SQL statement to sqlplus of Oracle 9i  Look at your grade of homework 3  Check out your groceries at Walmart

5 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Challenges to Maintain Transactions Hardware failures  Cashed stuck in ATM machine  Power failure… Software failures  Programming errors  System crash… User interference  Termination of transactions Concurrent users  Multiple users accessing the same item

6 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Designed Properties of Database Systems Atomicity Consistency Isolation Durability

7 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Atomicity Transaction needs to be executed as a unit Example  You should not cause the quantity of “The Dilbert Principle” of amazon.com decrease if you place your order and the order does not get through due to server errors Who are responsible for atomicity?  Transaction management system and  Recovery system

8 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Consistency Database implicit/explicit constraints need to be maintained Example:  Transferring money from one account to another in the same bank should not change your total amount of money Who are responsible for consistency?  Transaction management system and  Programmer

9 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Isolation Transaction A should not see partial results of transaction B Analogy:  When I update my website here and there, you should not see and think a tentative version as my final version Who are responsible for isolation?  Transaction management system

10 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Durability Any transaction committed needs to be in database for ever Example:  After you get the receipt of the water melon you buy from Alberson, the transaction is final and permanently reflected in the database system If you want to cancel it, that is another transaction Who are responsible for durability?  Transaction management system and  Recovery system

11 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Transaction’s State Diagram

12 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction An Ideal World No hardware failures No software failures No programming errors Do we still need transaction management?

13 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Why Concurrent Transactions? Parallelism Improved response time

14 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Schedule Schedules – sequences that indicate the chronological order in which instructions of concurrent transactions are executed  a schedule for a set of transactions must consist of all instructions of those transactions  must preserve the order in which the instructions appear in each individual transaction.

15 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Example Schedules

16 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Example Schedule (Cont.)

17 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Example Schedules

18 1/14/2005Yan Huang - CSCI5330 Database Implementation – Transaction Concurrency Control Some schedules are bad because the outcome of the schedule is not “predictable”


Download ppt "02/23/2005Yan Huang - CSCI5330 Database Implementation – Transaction Transaction I."

Similar presentations


Ads by Google