c09 Transaction Management Notes
c09 Transaction Management Notes
Management
WXES 2103
Database
Content
What is transaction
Transaction properties
Transaction management with SQL
Transaction log
DBMS Transaction Subsystem
Transaction Concepts
A transaction is a unit of program execution that
accesses and possibly updates various data
items.
A transaction must see a consistent database.
During transaction execution the database may
be inconsistent.
When the transaction is committed, the
database must be consistent.
ACID Properties
To preserve integrity of data, the database system
must ensure:
Atomicity.
Either all operations of the transaction are
properly reflected in the database or none are.
Consistency / Serializability.
Execution of a transaction in isolation preserves
the consistency of the database.
Transaction Log
Keep track of all transactions that update the DB
If failure occurs, information that was stored here
will be used for recovery
It is triggered by ROLL BACK statement,
program abnormal termination, or system failure
It stotes before-and-after data of the DB and the
tables, rows and attribute values that
participated in the transaction
Transaction state
Active, the initial state; the transaction stays in this state
while it is executing
Partially committed, after the final statement has been
executed.
Failed, after the discovery that normal execution can no
longer proceed.
Aborted, after the transaction has been rolled back and
the database restored to its state prior to the start of the
transaction. Two options after it has been aborted:
Access
Manager
Systems
Manager
Transaction
Manager
Scheduler/
Lock
Manager
Buffer
Manager
Recovery
Manager
File Manager
Database and
system
catalog
END
Next class Concurrency Control