Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transaction Processing Copyright © 2001 Patrick McDermott University of San Francisco Transactions are the Operational heartbeat of.

Similar presentations


Presentation on theme: "Transaction Processing Copyright © 2001 Patrick McDermott University of San Francisco Transactions are the Operational heartbeat of."— Presentation transcript:

1 Transaction Processing Copyright © 2001 Patrick McDermott University of San Francisco Transactions are the Operational heartbeat of the Organization.

2 The Compleat Programmer Language DataBase User Interface O/S, Network

3 Transactions A Transaction is a logical unit of work –A sequence of SQL statements –Can be in the eye of the beholder –Database consistency –Business consistency Some DBMS’s don’t support Transactions –All statements implicitly commit –MySQL –Access

4 Some Transactions Order taking system –Each ORDER is a Transaction Manufacturing process –Each ITEM produced is a Transaction Payables system –Each INVOICE is a Transaction

5 Oops! Gray Out, Plug Trip UPS [Uninterruptible Power Source] isn’t Programmer Error Deadlock –I’m a-waitin’ on you waitin’ on me Hardware Failure Fire, Earthquake Can be Intentional –Vandalism, Terrorism, Virus

6 The ACID Test Atomic –A unit of processing performed in its entirety, or not at all Consistent –Take the database from a state consistent with all constraints to a new state consistent with all constraints Isolated –No interference among concurrent transactions Durable –Must not be lost because of any failure

7 The Hooligans The Lost Update Half a Loaf –Half Eaten Dim Sum –Half Way Down Concurrency Related –The Dirty Read –Incorrect Summary –Non-Repeatable Read –Phantom Deadlocks Safe & Secure

8 The Details Log or Journal –Start –Old-New –Commit Buffer –Semi conductor versus persistent memory –Flush, or force write

9 COMMIT End the Transaction Commit the Database Flush Buffers –Write to Permanent Storage Release Locks Write Savepoint, Commit Point

10 Commit BUT What level? DBMS Vendor DBA Programmer/Analyst CIO Multiple machines can REALLY complicate things—2-phase commit Schedule equivalence: “testing for serializability is impractical in a real system”—we must wait for AI

11 Set Transaction Read ONLY Read Write Serializable –A DML statement that updates any resource in an uncommitted transaction FAILS Read Committed – Wait for locks to be released

12 Rollback DB Heimlich Maneuver Automatically or On command DB startup looks for Uncommitted Applications abends, GPFs B4 Commit –Abend = Abnormal Ending –GPS = General Protection Cost Rollforward –Recover from backup


Download ppt "Transaction Processing Copyright © 2001 Patrick McDermott University of San Francisco Transactions are the Operational heartbeat of."

Similar presentations


Ads by Google