ISDS-3110---Chap10 (1)

ISDS-3110---Chap10 (1) - Transaction Management and...

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

View Full Document Right Arrow Icon
Transaction Management and Concurrency Control Chapter 10
Background image of page 1

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

View Full DocumentRight Arrow Icon
What Is a Transaction? A transaction is a logical unit of work that must be either entirely completed or aborted; no intermediate states are acceptable. Most real-world database transactions are formed by two or more database requests . A database request is the equivalent of a single SQL statement in an application program or transaction. A transaction that changes the contents of the database must alter the database from one consistent database state to another. To ensure consistency of the database, every transaction must begin with the database in a known consistent state.
Background image of page 2
Example Of A Transaction What steps are involved in completing this transaction?
Background image of page 3

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

View Full DocumentRight Arrow Icon
Example of a Transaction An accountant wishes to register the credit sale of 100 units of product X to customer Y in the amount of $500.00: Reducing product X’s Quantity on hand by 100. Adding $500.00 to customer Y’s accounts receivable. UPDATE PRODUCT SET PROD_QOH = PROD_QOH - 100 WHERE PROD_CODE = ‘X’; UPDATE ACCREC SET AR_BALANCE = AR_BALANCE + 500 WHERE AR_NUM = ‘Y’; If the above two transactions are not completely executed, the transaction yields an inconsistent database . Why?
Background image of page 4
Transaction Management Ensure complete execution of a transaction Incomplete transactions must be rolled back Concurrency Control Special steps must be taken when two transactions attempt to use the same data at the same time Transaction Properties Atomicity Durability Serializability Isolation
Background image of page 5

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

View Full DocumentRight Arrow Icon
SQL Transaction support is provided by two SQL statements: COMMIT and ROLLBACK . When a transaction sequence is initiated, it must continue through all succeeding SQL statements until one of the following four events occurs: (1) A COMMIT statement is reached. (2) A ROLLBACK statement is reached. (3) The end of a program is successfully reached (equivalent to a COMMIT ). (4)
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/16/2012 for the course ISDS 3110 taught by Professor Chen,y during the Fall '08 term at LSU.

Page1 / 28

ISDS-3110---Chap10 (1) - Transaction Management and...

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

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