Session 3 : Transaction Management Flashcards

1
Q

What is a Transaction?

A

A sequence of information exchanges and related actions,
such as database updates, deletions, modifications, or insertions.

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

Consistent State of Database?

A
  • A successful transaction moves the database from one consistent state to another.
  • During execution, the database may be in an inconsistent state until the transaction is fully processed.
  • Transaction is considetered completed only when it is either fully commited or entirely aborded.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Database Request?

A

A database request refers to a single SQL statement executed within a transaction.

  • If a transacrion consists of two UPDATE statements and one INSERT statement, it includes three database requests.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Single-user vs Multi-user systems.

A

Single : most one user can use the system at a time.
Multi : many users can use the system concurrently.

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

Single-processor vs Multi-processor computer system

A

Single-processor :
* Transactions execute sequentially.
* Which may lead to slower perforamnce

Multi-processor :
* Capable of parallel processing. (Interleaving)
* High performance can be expected

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

Interleaving ?

A
  • Allows the DBMS to switch between operation of different transactions.
  • Concurrency in database is achieved through the interleaving, where multipe transactions are executed seemingly at the same time.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

4 important properties of transactions which DBMS must have?

A

ACID

  1. Atomicity
  2. Consistency
  3. Isolation
  4. Durability
  • Atomicity : A transaction in DBMS is either completely executed or not executed at all.
  • Consistency : Ensures the database remains in a vlid state. If consistency rules are violated, the transaction is rolled back, restoring the database to its original consistent state.
  • Isolation : Transactions are executed independently of one another. Data in use during a transaction is inaccessible to another transaction until the transaction is complete.
  • Durability : Committed data is permanently stored in the database. Once a transaction commits, its results are guaranteed to presist, even in case of system failures.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Serializability in DBMS?

A

Ensures that concurrent transactions produce a consistent database state.

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

Transaction states?

A
  • BEGIN_TRANSACTION: marks start of transaction.
  • READ OR WRITE: two possible operations on the data
  • END_TRANSACTION: end of transaction process
  • COMMIT_TRANSACTION: if no errors occur, save all changes to the database and mark transaction as complete.
  • ROLLBACK OR ABORT: signals unsuccessful end of transaction, change applied to DB must be done.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Transaction Log?

A

A history of all transactions executed by a database system.

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

Transaction log content?

A
  1. transaction id
  2. for each transaction component:
    * Type of operation
    * Table name
    * before and after values
    * pointers
  3. Transacion end
How well did you know this?
1
Not at all
2
3
4
5
Perfectly