Week 9 - Transaction Processing and JDBC Flashcards
Conflict
Occurs when multiple users try to access/modify entries in the DB at the same time.
Ways of addressing conflicts
Serialisation
Recovery (rollback)
Locking
Transaction
An action or series of actions carried out by a single user or application program, which reads/updates the contents of a DB.
ACID: Atomicity
A transaction should be treated as an indivisible unit. It should happen entirely or not happen at all.
ACID: Consistency
A transaction must transform the DB from one consistent state to another consistent state - only valid data will be written to the DB.
ACID: Isolation
Transactions should execute independently of each other.
Ensures the result of concurrent transactions is state equivalent to some serial order of execution.
ACID: Durability
Effects of a successful transaction must be permanently recorded in the DB
Which stages of ACID are managed by what?
Atomicity»_space;> Transaction Recovery Subsystem
Consistency»_space;> Programmers / DBMS module
Isolation»_space;> Concurrency Control Subsystem
Durability»_space;> Transaction Recovery Subsystem
Concurrency
The ability to execute multiple operations or transactions out-of-order or in partial order without affecting the outcome.
Out of order execution
Operations can be performed in any order as long as the final result is consistent
Partial order execution
Some operations can be executed in parallel without order, while others may need to follow a specific order.
Schedule
A list of atomic actions performed by one of a number of transactions.
Scheduling errors: Lost Update
A completed update by one user can be overridden by another user.
Scheduling errors: Uncommitted Dependency
Also known as “dirty read” (reading uncommitted data).
Reasons for not committing vary (e.g. connection or system problems).
Failure to commit causes a rollback, but other transactions are unaware of the rollback.
Scheduling errors: Inconsistent Analysis Problem
When a transaction’s analysis is inconsistent due to reading data that is in the middle of being updated by another transaction.