Do Everything or Nothing
- The process compiling related operations into single unit and executing them by "Do Everything Or Nothing" principle is called Transaction Management.
- Ex: Credit/Debit card processing of online transactions.
public void bm() {
try
{
Begin Transaction
operation1....
operation2....
operation3....
Commit Transaction
}
catch (Exception e)
{
rollback Transaction
}
}
- Transaction Management gives support to ACID properties
- A - Atomicity
- C - Consistency
- I - Isolation
- D - Durability
- Atomicity: Process of combining multiple and related indivisible operations into single unit.
- Consistency: Guarantee of "No rule violation" at the end of Transaction even though rules kept in database violated during the process.
- Isolation: Preventing concurrent and simultaneous operations on database data.
- Durability: The ability of bringing database software to normal state through log files and backup files when database is corrupted.
No comments:
Post a Comment