Transactions Flashcards
What is a transaction?
A unit of program execution that accesses and possibly updates various data items.
What does ACID stand for?
Atomic
Consistent
Isolated
Durable
What do we mean by atomic?
Either all operations of the transaction are properly reflected in the database or none are.
What do we mean by consistent?
Data must be in a consistent state before and after the transaction.
What do we mean by isolated?
Although multiple transactions may execute concurrently, each transaction must be unaware of other concurrently executing transactions.
What is meant by durable?
After a transaction completes successfully, the changes it has made to the database persist, even if there are system failures.
What are schedules?
sequences that indicate the chronological order in which instructions of concurrent transactions are executed
2 schedules are equivalent if:
- Involve same transactions
2.Transactions are ordered the same - Both schedules leave the db in the same final state
Schedule S is serializable if
S is equivalent to some serial schedule
Two operations conflict if:
- Are by different transactions
- Are on the same object
- At least one of the is a write
Two schedules are conflict equivalent iff:
- They involve the same actions of the same transactions
- Every pair of conflicting actions is ordered the same way
Schedules 1 and 2 are view equivalent if:
Same initial reads
Same dependent reads
Same winning writes
A schedule is irrecoverable if…
a transaction Tj reads the updated value of Ti then Tj committed before Ti commits.
Cascadeless vs strict schedule
In a casacdeless schedule, the read is only permitted after commit but a write can take place before commit. In a strict schedule…no reads and no writes before Tj is committed.