INFOTECH 31 (Transaction Management and Concurrency Control)

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/49

flashcard set

Earn XP

Description and Tags

for it31 haha..

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

50 Terms

1
New cards

Transaction

It is a logical unit of work that must be entirely completed or entirely aborted; there are no intermediate states.

2
New cards

Atomicity

it requires the completion of all operations and if not, it aborts the transaction.

3
New cards

Consistency

requires the permanence of the database’s consistent state. It aborts any transaction if parts of the transaction violate the integrity constraint.

4
New cards

Isolation

if a transaction is using any data another transaction cannot use it.

5
New cards

Durability

the DBMS cannot undo a committed data – even in the event of a system failure.

6
New cards

Serializability

this ensures that the schedule of concurrent transaction yields consistent result

7
New cards

Transaction Management with SQL

Commit or Rollback terminates a transaction.

8
New cards

Transaction Log

DBMSs maintains a transaction log to keep track of all transactions that update the database.

9
New cards

Concurrency Control

It is the coordination of simultaneous execution of transactions in a multiuser database environment.

10
New cards

Lost Update

This problem occurs when two concurrent transactions, say T1 and T2, are updating the same data element.

11
New cards

Inconsistent Retrievals

Occurs when a transaction access data before and after another transaction finish working with such data.

12
New cards

Scheduler

Is a special DBMS process that establishes the order in which the operations within concurrent transactions are executed.

13
New cards

Concurrency Control with Locking Methods

Lock guarantees exclusive use of the data item to the current transaction.

14
New cards

Lock Granularity

it indicates the level of lock in use. These levels include database, table, page, row or field.

15
New cards

Database Level

The transaction locks the entire database preventing other transaction access to tables even if the current transaction is not using it.

16
New cards

Table Level

Transaction T1 locks the entire table preventing other transactions (T2, T3, etc.) to have access to some of the table rows

17
New cards

Page Level

Transaction T1 locks the entire diskpage

18
New cards

Row Level

Transaction T1 locks the required row.

19
New cards

Field Level

This allows concurrent transactions to access the same row as long as they require the use of different fields (attributes) within that row.

20
New cards

Binary Locks

It has two states: locked (1) or unlocked (0)Shared/Exclusive Locks

21
New cards

Exclusive Locks

The transaction that locked the object has the sole access rights to the object.

22
New cards

Shared Locks

When concurrent transactions are granted read access on the basis of a common lock.

23
New cards

Lock manager

has to know beforehand the type of lock before a lock can be granted.

24
New cards

READ_LOCK

to check the type of lock

25
New cards

WRITE_LOCK

issue the lock

26
New cards

UNLOCK

release the lock

27
New cards

Two-Phase Locking to Ensure Serializability

Define the way a transaction acquire and relinquish locks.

28
New cards

Growing Phase

the time the transaction acquires all the required locks without releasing any data. After acquiring all the locks, the transaction is now in its locked point.

29
New cards

Shrinking Phase

the time when the transaction releases all the locks and is no longer able to obtain any new lock.

30
New cards

Deadlock

occurs when two transactions wait indefinitely for each other to unlock data

31
New cards

Deadlock prevention

the DBMS aborts a transaction requesting a new lock if the possibility of deadlock can occur.

32
New cards

Deadlock detection

DBMS periodically check the database for deadlocks. If there is a deadlock, one of the transaction is aborted – the “victim.”

33
New cards

Deadlock avoidance

the transaction must obtain all of the lock it needs before it can start to execute. Requires that transactions obtain locks in succession.

34
New cards

Concurrency Control with Time Stamping Methods

This approach to scheduling assigns global, unique time stamp to each of the concurrent transactions.

35
New cards

Concurrency Control with Optimistic Methods

The assumption here is that majority of the transactions do not conflict.

36
New cards

Read phase

the transaction reads the database, executes the needed computations, and makes the updates to a private copy of the database.

37
New cards

Validation Phase

It validates the transaction to ensure that changes do not affect the integrity and consistency of the database.

38
New cards

Write Phase

Changes to the database becomes permanent.

39
New cards

Uncommitted read

also known as dirty read. It is the lowest level of isolation, and provides the highest degree of concurrency.

40
New cards

Cursor stability

the default isolation level [up to DB2 9.5].

41
New cards

Currently committed

the new default behavior [ starting with DB2 9.7] for the cursor stability isolation level.

42
New cards

Read stability

All the rows an application retrieves within a unit of work are locked.

43
New cards

Repeatable read

It is the highest isolation level

44
New cards

Isolation level

is normally defined at the session or Application Level.

45
New cards

Lock Escalation

Occurs when the optimizer thinks that it is better to lock on the entire table rather than multiple row locks.

46
New cards

Locklist

The amount of memory (in 4k pages) reserved to manage locks for all connected applications.

47
New cards

Maxlocks

Maximum percentage of the entire lock list that a single application can use up.

48
New cards

Lock Wait

When two or more applications need to perform an operation on the same object, one of them may have to wait to obtain the needed lock.

49
New cards

Locktimeout

The time an application waits for a lock is controlled by the database configuration parameter

50
New cards

Current Lock Timeout

can be used to set the lock wait for a given connection.