08transaction.ppt - Introduction to Transaction Processing Gang Qian Department of Computer Science University of Central Oklahoma 1 Overview(Chapter 20

08transaction.ppt - Introduction to Transaction Processing...

This preview shows page 1 - 12 out of 38 pages.

1 Introduction to Transaction Processing Gang Qian Department of Computer Science University of Central Oklahoma
Image of page 1
2 Overview (Chapter 20) Introduction to Transaction Processing Transaction Concepts Transaction Schedule Concepts Conflict Serializability View Serializability
Image of page 2
3 Introduction to Transaction Processing Data is accessed concurrently For efficiency purpose The problem is how can we maintain the consistency in the data The purpose of transaction processing is to allow maximum concurrent data processing while producing the same effect as if the tasks are processed one by one
Image of page 3
4 Example 1 Transfer $500 from saving to checking and log All statements in the transaction need to be performed Any problem should cause all operations to be cancelled (rollback) Insufficient fund, invalid account, hardware failure, etc. Atomicity of transactions
Image of page 4
5 Example 2 Current balance $ 1000 Transaction 1: add $100 to balance Transaction 2: add $200 to balance We have interleaved operations as shown in next slide What is the final balance?
Image of page 5
6
Image of page 6
7 Example 3 Tran1: Transfer $ 50 from saving to checking account Tran 2: Withdraw $10 from the same checking account T1 crashes before “write sbal-50” Need to rollback Cascading effect on T2
Image of page 7
8 The System Log Log or Journal : The log keeps track of all transaction operations that affect the values of database items. The log is kept on disk, so it is not affected by any type of failure except for disk or catastrophic failure In addition, the log is periodically backed up to archival storage (tape) to guard against such catastrophic failures It is used for transaction recovery
Image of page 8
9 Transactions A Transaction : Logical unit of database processing that includes one or more access operations: Read: retrieval Write: insert or update, delete A transaction (a set of operations) may be interactive SQL commands, or may be embedded within a program Transaction boundaries : Begin and End transaction Oracle: The completion of one transaction starts the next one
Image of page 9
10 Properties of Transactions (ACID) Atomicity : A transaction is an atomic unit of processing; it is either performed in its entirety or not performed at all Consistency preservation : A correct execution of the transaction must take the database from one consistent state to another. Isolation : A transaction should not make its updates visible to other transactions until it is committed Enforcing this property will make cascading rollbacks of transactions unnecessary Durability or permanency : Once a transaction changes the database and the changes are committed, these changes must never be lost because of subsequent failure
Image of page 10
11 A SIMPLE MODEL OF A DATABASE (for purposes of discussing transactions): A database is a collection of named data items Granularity of data - a field, a record , or a whole disk block (Concepts are independent of granularity)
Image of page 11
Image of page 12

You've reached the end of your free preview.

Want to read all 38 pages?

  • Fall '16

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors