10. transaction concurrency

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/54

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

55 Terms

1
New cards

transaction

A logical unit of work that must be entirely completed or aborted

2
New cards

what is a database request

the equivalent of a single SQL statement in an application program or transaction.

3
New cards

atomicity

all operations of a transaction are completed; if not aborted

4
New cards

consistency

Permanence of database’s consistent state

5
New cards

isolation

Data used during transaction cannot be used by second transaction until the first is completed

6
New cards

durability

Ensures that once transactions are committed they cannot be undone or lost

7
New cards

serializability

Ensures that the schedule for the concurrent execution of several transactions should yield consistent results

8
New cards

single user database systems

  • serializability and isolation: automatially maintained

  • ACID: must guarantee Atomicity, Durability, and Consistency

  • error recovery: Manage recovery from operating system errors, power interruptions, and application crashes.

9
New cards

multiuser database systems

  • concurrent transactions: Typically handle multiple transactions at the same time

  • control mechanism: Implement controls to ensure serializability and isolation.

  • ACID: maintain atomicity, durability, consistency, and isolation

10
New cards

transaction interference

risks when concurrent transactions interact with the same dataset

11
New cards

update conflicts

risks when potential inconsistency if one transaction updates data before another completes

12
New cards

concurrency control

Coordination of the simultaneous transactions execution in a multiuser database system

13
New cards

lost update

A situation where a transaction updates a data item after another transaction has read it, resulting in the last update overwriting changes made by the first without being aware.

14
New cards

uncommitted data

occurs when two transactions happen at the same time and the first transaction is rolled back after the second one has already accessed uncommitted data

15
New cards

inconsistent retrievals

A transaction accesses data before and after one or more other transactions finish working with such data

16
New cards

serializable schedule

interleaved execution of transactions yields the same results as the serial execution of the transactions

17
New cards

locking methods do..

facilitate isolation of data items used in concurrently
executing transactions

18
New cards

pessimistic locking

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

19
New cards

binary lock (locked)

  • If an object is locked by a transaction, no other transaction can use that object

20
New cards

binary lock (unlocked)

  • If an object is unlocked, any transaction can lock the object for its use

21
New cards

exclusive lock

Access is reserved for the transaction that locked the object

22
New cards

shared lock

Concurrent transactions are granted read access on the basis of a common lock

23
New cards

problems with locks

affect serializability and the schedule might create deadlocks

24
New cards

two phase locking does not do what?

ensure deadlocks

25
New cards

two phase locking does what?

ensure serializability

26
New cards

growing phase

transaction acquires all required locks without unlocking any data

27
New cards

shrinking phase

transaction releases all locks and cannot obtain any new lock

28
New cards

two transactions cannot have

two of the same locks

29
New cards

no unlock operation can..

precede a lock operation in the same transaction

30
New cards

for locking, no data are effected until

all of the locks are obtained

31
New cards

deadlocks

occur when two transactions are waiting for the other to unlock data (deadly embrace)

32
New cards

concurrency control with time stamps

  • ensures no equal time stamp values exist

  • Monotonicity: ensures time stamp values always increases

33
New cards

disadvantages of time stamping

  • more space and resources

  • each value store in database needs two more time stamp fields

  • more processing

34
New cards

wait/die

A concurrency control scheme in which an older transaction must wait for the
younger transaction to complete and release the locks before requesting the locks itself

35
New cards

wound/wait

A concurrency control scheme in which an older transaction can request the lock, preempt the younger transaction, and reschedule it

36
New cards

optimistic methods

based on the assumption that the majority of database operations do not conflict

37
New cards

read phase

Reads the database
- Executes the needed computations
- Makes the updates to a private copy of the database values

38
New cards

validation phase

Transaction is validated to ensure that the changes made will not affect the integrity and consistency of the database

39
New cards

write phase

Changes are permanently applied to the database

40
New cards

transaction isolation levels

refer to the degree to which transaction data is “protected or isolated” from other concurrent transactions

41
New cards

transaction isolation levels are described as..

by the type of “reads” that a transaction allows or not

42
New cards

dirty read

transaction can read data that is not yet committed

43
New cards

nonrepeatable read

transaction reads a given row at time t1, and then it reads the same row at time t2, yielding different results

44
New cards

phantom read

transaction executes a query at time t1, and then it runs the same query at time t2, yielding additional rows that satisfy the query

45
New cards

(ANSI) Read uncommitted

  • reads uncommitted data from other transactions

  • increases transaction performance but at cost of consistency

46
New cards

(ANSI) Read Committed

  • forces transactions to read only committed data

  • default for most databases

47
New cards

(ANSI) repeatable read

  • ensures that queries return consistent results

  • Uses shared locks to ensure other transactions do not update a row after the original query reads it

48
New cards

(ANSI) Serializable isolation level

  • the most restrictive level defined by the ANSI SQL
    standard

49
New cards

recovery transactions are based on

atomic transaction property

50
New cards

write ahead log protocol

Ensures that transaction logs are always written before the data are updated

51
New cards

Redundant transaction logs

Ensure that a physical disk failure will not impair the DBMS’s ability to recover data

52
New cards

buffers

Temporary storage areas in a primary memory used to speed up disk operations

53
New cards

checkpoints

Allows DBMS to write all its updated buffers in memory to disk

54
New cards

Deferred-write technique or deferred update

Transaction operations do not immediately update the physical database
- Only transaction log is updated

55
New cards

Write-through technique or immediate update

Database is immediately updated by transaction operations during transaction’s execution