Week 8 Quiz Flashcards
What is a transaction?
Logical unit of work that must be entirely completed or aborted
What does a transaction consist of?
SELECT statement
Series of related UPDATE statements
Series of INSERT statements
Combination of SELECT, UPDATE, and INSERT statements
Consistent database state:
All data integrity constraints are satisfied
Database requests:
Equivalent of a single SQL statement in an application program or transaction
5 transaction properties:
Atomicity: All operations of a transaction must be completed
Consistency: Permanence of database’s consistent state:
Isolation: Data used during transaction cannot be used by second transaction until the first is completed
Durability: Ensures that once transactions are committed, they cannot be undone or lost
Serializability: Ensures that the schedule for the concurrent execution of several transactions should yield consistent results
SQL statements that provide transaction support:
- COMMIT
- ROLLBACK
Transaction sequence must continue until:
- COMMIT statement is reached
- ROLLBACK statement is reached
- End of program is reached
- Program is abnormally terminated
Features of the transaction log:
Keeps track of all transactions that update the database
DBMS uses the information stored in a log for:
- Recovery requirement triggered by a ROLLBACK statement
- A program’s abnormal termination
- A system failure
Concurrency control:
Coordination of the simultaneous transactions execution in a multiuser database system
Objective - Ensures serializability of transactions in a multiuser database environment
Problems in concurrency control:
Lost update
Occurs when same data element is updated, or one of the updates is lost
Uncommitted data
Occurs when two transactions are executed concurrently, or if the first transaction is rolled back after the second transaction has already accessed uncommitted data
Inconsistent retrievals
Occurs when a transaction accesses data before and after one or more other transactions finish working with such data
Features of the scheduler:
Establishes the order in which the operations are executed within concurrent transactions
Creates serialization schedule
Serializable schedule: Interleaved execution of transactions yields the same results as the serial execution of the transactions