ADBMS: Transactions

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

1/51

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

52 Terms

1
New cards

Transaction

refers to a sequence of one or more operations (such as read, write, update, or delete) performed on the database as a single logical unit of work.

2
New cards

Transaction

single logical unit of work.

3
New cards

Trnsaction

ensures that either all the operations are successfully executed (committed) or none of them take effect (rolled back).

4
New cards

Committed

Rollback

A transaction ensures that either all the operations are successfully executed (____) or none of them take effect (______).

5
New cards

Transaction

are designed to maintain the integrity, consistency and reliability of the database, even in the case of system failures or concurrent access.

6
New cards

Inconsistent

During the transaction the database is ____

7
New cards

Committed

Only once the database is ____ the state is changed from one consistent state to another.

8
New cards

Transaction

is a program unit whose execution may or may not change the contents of a database.

9
New cards

Single unit

The transaction is executed as a

10
New cards

read-only transaction

If the database operations do not update the database but only retrieve data, this type of transaction is called a

11
New cards

CONSISTENT STATE

A successful transaction can change the database from one _____ to another.

12
New cards

Atomic, consistent, isolated and durable

DBMS transactions must be

13
New cards

read operation/Read(X)

is used to read the value of a particular database element X and stores it in a temporary buffer in the main memory for further actions such as displaying that value.

14
New cards

write operation/Write(X)

stores updated data from main memory back to the database. It usually follows a read, where data is fetched, modified

(e.g., arithmetic changes) and then written back to save the updated value

15
New cards

Read

SELECT balance FROM accounts WHERE account_id = 'A123’;

16
New cards

Write

•UPDATE accounts SET balance = balance - 100 WHERE account_id = 'A123’;

17
New cards

Commit

This operation in transactions is used to maintain integrity in the database. Due to

some failure of power, hardware, or software, etc., a transaction might get

interrupted before all its operations are completed. This may cause ambiguity in the database, i.e. it might get inconsistent before and after the transaction

18
New cards

committed

Once the transaction is _____, the changes to the database are permanent and

the transaction is considered successful.

19
New cards

rollback

undoes all changes made by a transaction if an error occurs,

restoring the database to its last consistent state. It helps prevent data

inconsistency and ensures safety.

20
New cards

Rolled back

Example: Suppose during the money transfer process, the system encounters

an issue, like insufficient funds in the sender’s account. In that case, the

transaction is ___&

21
New cards

Rollback

This will undo all the operations performed so far and ensure that the database remains consistent.

22
New cards

Atomicity

Consistency

Isolation

Durability

ACID Properties of Transaction

23
New cards

Atomicity

A transaction is all or nothing. If any part fails, the entire

transaction is rolled back.

24
New cards

Atomicity

Example: While transferring money, both

debit and credit must succeed. If one fails, nothing should change.

25
New cards

Consistency

A transaction must keep the database in a valid state,

moving it from one consistent state to another.

26
New cards

Consistency

Example: If balance is ₹1000 and ₹200 is withdrawn, the new balance should be ₹800.

27
New cards

Isolation

Transactions run independently. One transaction’s

operations should not affect another’s intermediate steps.

28
New cards

Isolated

Example: Two users withdrawing from the same account must not interfere with each other’s balance updates.

29
New cards

Durability

Once a transaction is committed, its changes stay even if

the system crashes

30
New cards

Serial and Non-Serial Schedule

Transaction Schedules

31
New cards

Serial Schedule

transactions execute one at a time, ensuring

database consistency but increasing waiting time and reducing system

throughput.

32
New cards

Serial schedule

To improve throughput while maintaining consistency,

concurrent schedules with strict rules are used, allowing safe

simultaneous execution of transactions.

33
New cards

Non-Serial Schedule

multiple transactions are executed concurrently, interleaving their operations, instead of running one after another

34
New cards

Non-Serial Schedule

It improves system efficiency but requires concurrency control to maintain database consistency.

35
New cards

Transaction Recovery Techniques in DBMS

When a system failure occurs during a transaction (such as power

failure, hardware malfunction, software error, or deadlock), the

database can become inconsistent or partially updated.

36
New cards

Recovery Techniques

are designed to restore the database to a consistent state, ensuring the ACID properties are maintained.

37
New cards

Checkpointing

is a snapshot of the database state at a specific point in time.

38
New cards

Checkpointing

During recovery, the system does not have to start from scratch; it can

roll back to the last checkpoint and replay committed transactions.

39
New cards

Undo and Redo

Recovery involves two essential types of operations:

40
New cards

Undo

Revert the effects of incomplete or uncommitted transactions.

41
New cards

Redo

Reapply committed transactions that might not have been written to disk at the time of failure.

42
New cards

Write-Ahead Logging (WAL)

principle ensures that log records

describing changes are written to stable storage before the changes themselves are applied to the database.

43
New cards

WAL

Write-Ahead Logging

44
New cards

Deferred Update

In this approach, the system does not write changes to the database immediately

45
New cards

Deferred Update

No Undo/Redo approach

46
New cards

Deferred Update

In this approach, the system does not write changes to the database immediately.

47
New cards

Deferred Update

Changes are made in temporary memory (buffer).

48
New cards

Deferred Update

Only after a COMMIT is the data written to the database.

49
New cards

Shadow Paging

•Instead of modifying the actual database pages directly, the system

maintains a shadow copy of the database.

50
New cards

https://www.geeksforgeeks.org/dbms/transaction-in-dbms/

Reference

51
New cards

Shadow Paging

Once the transaction successfully commits, the new version replaces the old version atomically.

52
New cards

Shadow Paging

All operations are performed on a copy.