90 likes | 259 Views
DBST 652 – Lecture 8 – Part 1. Transactions. Transaction Processing. Logical units of database processing Examples - banking, reservations, stock markets ATM - transfer $100 from savings to checking. Transaction Processing.
E N D
DBST 652 – Lecture 8 – Part 1 • Transactions
Transaction Processing • Logical units of database processing • Examples - banking, reservations, stock markets • ATM - transfer $100 from savings to checking
Transaction Processing • Multiuser systems - job A gets some time, then job B, then job A and so on. • Could also have parallel processing. Job A runs while job B runs. • See p. 611 - figure 17.1
Transaction Processing • Transaction - logical unit of work • Could involve inserts, updates, deletes • see steps for reads and writes on p. 555
Transaction Processing • Problems with concurrency - if not controlled: • 1. Lost update • 2. Dirty read (temporary update) • 3. Incorrect summary
Transaction Processing • Transaction - either all completes or no change to the database remains • COMMIT or ROLLBACK
Transaction Processing • Easier said than done - what could keep from completing transaction? • Computer crash • system error • local errors • deadlock • disk failure • p. 616 has list
Transaction Processing • Need to keep track of transactions so can recover to a consistent point in time • Tracks begin, read/write/delete, end, commit, rollback • look at diagram on p. 618
Transaction Processing • A log keeps track of transactions • Has before and after data • Used to recover database See Part 1b next