Transaction Management Flashcards

1
Q

Transaction

A

Process which takes the database from one consistent state to another consistent state. They basically exist to ensure that the data and operations you work with succeed in full.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

ACID Properties

A
  • Atomic: All transaction actions will be completed, or nothing
  • Consistent: After commit/abort, data satisfy all integrity constraints
  • Isolation: Any changes are invisible to other transactions until commit
  • Durable: Nothing is lost in future; failures occurring after commit cause no loss of data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Anomalies from Interleaved Execution

A

Reading Uncommitted Data (dirty reads)

Unrepeatable Reads

Overwriting Uncommitted Data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Reading uncommitted data(“dirty reads”)

A

A dirty read occurs if one transaction reads data that has been modified by another transaction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Unrepeatable reads

A

A non-repeatable read occurs when a object is read twice within a transaction; and between the reads, it is modified by another transaction, therefore, the second read returns different values as compared to the first; i.e., the read operation is non-repeatable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Overwriting uncommitted data

A

A lost update occurs when two transactions read the same object and then modify this object independently. The transaction that is committed last overwrites the changes made by the earlier transaction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Two-Phase Locking Protocol

A

The Two-Phase Locking protocol allows each transaction to make a lock or unlock request in two steps:
• Growing Phase: In this phase transaction may obtain locks but may not release any locks.
• Shrinking Phase: In this phase, a transaction may release locks but not obtain any new lock
It is true that the 2PL protocol offers serializability. However, it does not ensure that deadlocks do not happen.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Strict Two-Phase Locking Method

A

Strict-Two phase locking system is almost similar to 2PL. The only difference is that Strict-2PL never releases a lock after using it. It holds all the locks until the commit point and releases all the locks at one go when the process is over.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Transaction Syntax SQL

A

START TRANSACTION

COMMIT

ROLLBACK

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

BASE

A

Basically Available Soft State Eventually Consistent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly