Transaction management Flashcards

1
Q

Interleaving of operations

A

mix (digital signals) by alternating between them.

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

pessimistic locking

A

The use of locks based on the assumption that conflict between transactions is likely.

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

three main transaction problems

A

lost updates, uncommitted data, and inconsistent retrievals

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

lost updates

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

uncommitted data

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

inconsistent retrievals

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. Explain the following statement: A transaction is a logical unit of work.
A

A transaction is a sequence of database operations that access the database. A trans- action is a logical unit of work; that is, all parts are executed or the transaction is aborted. A transaction takes a database from one consistent state to another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  1. What is a consistent database state, and how is it achieved?
A

A consis- tent database state is one in which all data integrity constraints are satisfied.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  1. What is a transaction log, and what is its function?
A

The transaction log keeps track of all transactions that modify the database. The information stored in the transaction log is used for recovery (ROLLBACK) purposes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. List the four individual transaction properties.
A

Transactions have four main properties: atomicity, consistency, isolation, and dura- bility.

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

Atomicity

A

Atomicity means that all parts of the transaction must be executed; otherwise, the transaction is aborted.

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

Consistency

A

Consistency means that the database’s consistent state is maintained.

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

Isolation

A

Isolation means that data used by one transaction cannot be accessed by another transaction until the first one is completed.

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

Durability

A

Durability means that changes made by a transaction cannot be rolled back once the transaction is committed

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

B. (2 points) What is two-phase locking (2PL)? Give an example to illustrate how deadlock may happen with two phase locking.

A

The two-phase locking schema has a growing phase, in which the transaction acquires all of the locks that it needs without unlocking any data, and a shrinking phase, in which the transaction releases all of the locks without acquiring new locks.

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

What is a lock, and how does it work in general?

A

The scheduler uses locking to ensure the serializability of transactions.

A lock guarantees unique access to a data item by a transaction. The lock prevents one transaction from using the data item while another transaction is using it

17
Q
  1. What are the different levels of lock granularity?
A

database, table, page, row, and field

18
Q
  1. What is concurrency control, and what is its objective?
A

Concurrency control coordinates the simultaneous execution of transactions. The objective of concurrency control is to ensure the serializability of transactions in a multiuser database environment

19
Q

serializability

A

the result of the concurrent execution of transactions is the same as that of the transactions being executed in serial order.

20
Q
  1. What is an exclusive lock, and under what circumstances is it granted?
A

An exclusive lock is issued when a transaction wants to update (write to) the database and no other locks (shared or exclusive) are held on the data.

21
Q

binary lock

A

binary lock can have only two states: locked (1) or unlocked (0).

22
Q

shared lock

A

A shared lock is used when a transac- tion wants to read data from a database and no other transaction is updating the same data. Several shared or “read” locks can exist for a particular item

23
Q
  1. What is a deadlock, and how can it be avoided? Discuss several strategies for dealing with deadlocks.
A

When two or more transactions wait indefinitely for each other to release a lock, they are in a deadlock, also called a deadly embrace. There are three deadlock control techniques: prevention, detection, and avoidance.

24
Q

Two-Phase Locking

A
25
Q

Difference between lost update and uncommitted data

A
  • In uncomitted data one transaction must have accessed uncommited data from another transaction. In lost update this doesn’t happens