Unit 4 Flashcards

1
Q

What is transaction ?

A

set of operations used to perform a logical unit of work.

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

What is Full form of ACID (properties) ?

A

Atomicity , Consistency , Isolation , Durability.

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

Meaning of Atomicity in context of Transactions ?

A

Either all operations are performed or none.

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

Meaning of Consistency in context of Transactions ?

A

Before and after transaction sum of money should be same. (state of data should should be consistent)

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

Meaning of Isolation in context of Transactions ?

A

A parallel schedule should be able to converted into serial schedule to achieve consistancy.

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

Meaning of Durability in context of Transactions ?

A

Changes made in DB should be permanent.

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

What are the operation that are performed in a transaction

A
  1. Read
  2. Write
  3. Commit
  4. Rollback
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are states of transaction

A
  1. Active
  2. Partially Committed
  3. Commited
  4. Terminated State : (Involves Resource Deallocation)
  5. Failed
  6. Abort :
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What happens in active state ?

A

The transaction begins and is actively executing operations.
It can read and write in this state
ex. A bank transaction starts by reading your account balance.

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

What happens in partially committed state

A

Transaction has finished it’s operations, but changes have not yet been parmanently saved (commited) to database.

ex. after removing money from your account and adding to another account , the transaction is ready to be finalized but hasn’t been saved yet.

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

What happens in committed state ?

A

The transaction is successfully completed, and all changes are permanently saved in the database.

Example: The money transfer is now permanent, and both account balances are updated.

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

What happens in failed state

A

Something goes wrong during the transaction (e.g., a system crash or a data error).
The transaction cannot proceed to the next step. It goes in failed state.
Example: If there’s a power failure while transferring money, the transaction cannot continue.

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

What happens in aborted state ?

A

In this state , the transaction is rolled back, undoing any changes made during its active state.

To achieve consistency

Example: If the power failure occurs, the transaction will undo the transfer, returning the account balances to their original amounts.

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

What happens in terminated State ?

A

This state is achieved when transaction has finished it’s process either by committing or abortion.

Final state where transaction ends.
Example: After either successfully transferring the money or rolling back the changes due to an error, the transaction is considered complete.

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

What is schedule ?

A

It is chronological execution sequence of multiple transactions

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

What are types of schedule

A
  • Based on Serializability
  1. Serial Schedule
  2. Parallel Schedule
  • Based on Recoverability
  1. Recoverable
  2. Irrecoverable
17
Q

What is serial Scheduling

A

In this scheduling execution of one transaction stats only after completion of Other transaction

This scheduling can be carried in controlled way.

Here Database remains consistent by nature

ex. In ATM one user can at a time withdraw money

18
Q

What is parallel transaction

A

More than one transactions are executed at a time.

Waiting time is less for all transactions. i.e. throughput increases.

19
Q

what is recoverable and irrecoverable schedule

A

A recoverable schedule in database transaction management ensures that if a transaction needs to be rolled back due to a failure, it doesn’t cause other dependent transactions to be in an inconsistent state.

irrocoverable don’t guarantee consistance after system in between failure

20
Q

Example of recoverable schedule

A

T1 :R(A)
T1 : A=A+10
T1 : W(A)
T2 : R(A) (Dirty Read)
T2: A=A-5
T2 : W(A)
C : T1
C : T2

21
Q

How to identify if some process is irrecoverable

A

If one transaction is doing dirty read and the one who is doing dirty read (copying is commited before) then it is irrecoverable otherwise recoverable

22
Q

example of irrecoverable schedule

A

T1 :R(A)
T1 : A=A+10
T1 : W(A)
T2 : R(A) (Dirty Read)
T2: A=A-5
T2 : W(A)
C : T2
C : T1

23
Q

What is cascade roleback ?

A

A cascaded rollback occurs when a failure in one transaction causes other transactions, which have read data from the failed transaction, to also be rolled back. This can lead to a chain reaction of rollbacks.

24
Q

What is cascadeless roleback

A

A cascadeless rollback avoids chain reaction of roleback by ensuring that transactions only read data that has already been committed by other transactions. This way, if a transaction fails and rolls back, it doesn’t affect other transactions.

25
Q

how to achieve cascadelessness

A

to achieve cascadelessness we have to completely avoid dirty read problem i.e. one transaction only reads when its previous process has commited its transaction

26
Q

When can we say that schedule is conflict serializable

A

When we swap any non conflicting operations and they became e

27
Q
A