1: Transaction Processing Flashcards

1
Q

What is a transaction ?

A

An action, or series of actions, carried out by a single user or application program, which reads or updates the contents of the database.

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

What is a logical unit of work ?

A

It’s a transaction. That transforms the database from one consistent state to another.

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

What other units are transactions?

A

Unit of :

- Concurrency
- Recovery
- Work

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

What are the 4 ACID properties?

A
  • Atomicity
  • Consistency
  • Isolation
  • Durability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How are transactions reliable and consistent, and to what mechanisms do they relate to ?

A

The are due to the “ACIDity” properties of transactions.

They relate to the concurrency control and recovery mechanisms:

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

What are the 3 types of schedules ?

A
  • Schedule: preserves the order of the operations
  • Serial schedule: executed consecutively without interleaved operations from other transactions
  • Nonserial schedule: concurrent transactions are interleaved
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When/how is a schedule conflict serialisable ?

A

If it is (conflict) equivalent to some serial schedule.

Any conflicting operations are ordered in the same way as some serial schedule.

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

Give the type of schedule:

Sa: read(T1, X); read(T2, X); write(T1, X); write(T2, X); commit(T1); commit(T2);

A
  • Not conflict serializable – there is a cycle in the precedence graph because read(T2,X) conflicts with write(T1, X) and Write(T1, X) conflicts with write(T2, X)

T1 T2

  • Recoverable – because T1 is the first to write item X and it commits before T2 commits
  • Avoids cascading abort (cascadeless) – because T1, having written item X before T2 writes item X, commits first
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Give the type of schedule:

Sb: read(T1, X); read(T2, Y); read(T3, X); write(T3, X); read(T2, X); read(T1, Y); abort(T3); commit(T1); commit(T2);

A
  • Conflict serializable – no cycle (gives T1 >T3 >T2)
  • Recoverable - T3 is the first to write X and then T2 reads X, so T3 should commit first. However, T3 aborts so there is no effect on the item
  • Cascading abort - T3 abort means T2 would also have to abort as it has read the value of an aborted transaction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Give the type of schedule:

Sc: read(T1, X); read(T2, X); write(T1, X); read(T1, Y); write(T2, X); commit(T2); write(T1, X); commit(T1);

A
  • Not Conflict serializable
  • Recoverable – T1 is the first to write X so it should commit first. However, T2 does not read X after the T1 write
  • Avoids cascading abort (cascadeless) – no aborted transactions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly