Week 10 - 9/11/2009 1 Transactions and Transactions and...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 9/11/2009 1 Transactions and Transactions and Concurrency Controls Concurrency Controls Turbo-charging your RDBMS Week 10 What is a transaction? What is a transaction? Logical unit of work Must be completed entirely or aborted No intermediate states 10-2 9/11/2009 2 Example Example Assume the following SQL Consistent state after transaction is executed No changes made to database SELECT ACC_NUM, ACC_BALANCE FROM CHECKACC WHERE ACC_NUM = 0908110638; 10-3 Example (contd) Example (contd) Register credit sale of 100 units of product X to customer Y for $500 State is consistent if both transactions complete DBMS does not guarantee this UPDATE PRODUCT SET PROD_QOH = PROD_QOH - 100 WHERE PROD_CODE = X; 10-4 UPDATE ACCT_RECEIVABLE SET ACCT_BALANCE = ACCT_BALANCE + 500 WHERE ACCT_NUM = Y; 9/11/2009 3 Desirable properties of transactions Desirable properties of transactions Atomicity All transaction operations must be completed Incomplete transactions aborted Incomplete transactions aborted Consistency (Serializability) Maps one consistent database state to another Isolation Transaction data cannot be reused until its execution complete 10-5 Durability Permanence of consistent DB state once a transaction commits Usually called ACID properties of a transaction Transaction management in SQL Transaction management in SQL Transaction support COMMIT ROLLBACK A transaction sequence must continue until: COMMIT statement is reached ROLLBACK statement is reached 10-6 ROLLBACK statement is reached End of a program reached Program reaches abnormal termination 9/11/2009...
View Full Document

Page1 / 15

Week 10 - 9/11/2009 1 Transactions and Transactions and...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online