Unit 4 Flashcards
What is transaction ?
set of operations used to perform a logical unit of work.
What is Full form of ACID (properties) ?
Atomicity , Consistency , Isolation , Durability.
Meaning of Atomicity in context of Transactions ?
Either all operations are performed or none.
Meaning of Consistency in context of Transactions ?
Before and after transaction sum of money should be same. (state of data should should be consistent)
Meaning of Isolation in context of Transactions ?
A parallel schedule should be able to converted into serial schedule to achieve consistancy.
Meaning of Durability in context of Transactions ?
Changes made in DB should be permanent.
What are the operation that are performed in a transaction
- Read
- Write
- Commit
- Rollback
What are states of transaction
- Active
- Partially Committed
- Commited
- Terminated State : (Involves Resource Deallocation)
- Failed
- Abort :
What happens in active state ?
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.
What happens in partially committed state
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.
What happens in committed state ?
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.
What happens in failed state
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.
What happens in aborted state ?
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.
What happens in terminated State ?
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.
What is schedule ?
It is chronological execution sequence of multiple transactions