con
Transaction Management
A sequence of Many actions which are considered to bo On atomic unit work. A transaction is a collection of operations involving data itomo in a database, There are four important properties of transactions that a DBMS must ensure to maintain data in the face of concurrent access and system failures,
Atomicity
Atomicity requires that each transaction is all or nothing. If one part of the transaction fails, the entire transaction fails, and the database state is left unchanged.
Consistency
If each transaction is consistent and the data base starts on as consistent, it ends up as consistent.
Isolation
Execution of one transaction is isolated from that of another transactions. It ensures that concurrent execution of transaction results in a system state that would be obtained if transaction were executed serially, i.e., one after the other.
Durability
Durability means that once a transaction has been committed, it will remain even in the event of power loss, crashes, or errors. In a relational database, for instance, once a group of SQL statements execute, the results need to be stored permanently.
Key Points
- In computer science, ACID (Atomicity, Consistency, Isolation, Durability) is a set of Properties that guarantee that database transactions are processed reliably.
- In the context of databases, a single logical operation on the data is called a transact
- of funds from one bank account to another, even involving multiple
changes such as debiting one account and crediting another, is a single transaction
………….
If a transaction commits, its effects persist.
A transaction starts with any SQL statement and ends with a commit or ROLLBACK.
- COMMIT statement makes changes permanent to the database.
- ROLLBACK statement reverses changes.
- A transaction includes one or more database access Operations. These
can include insertion, deletion, modification or retrieval operations.
Database Access Operations
The basic database access operations are
- Read-item(X) Reads a database item tem named X into a progtam variable or R(X).
- Write-item (X) Writes the value of program variable X into the database item named x W(X).
Classification of a Database System According to the Number of Users
Single User
A DBMS is single user, if at most one user at a time can use the system,
Multiuser
A DBMS is multiuser, if many user can use the system and hence access; the database concurrently.
e.g., An airline reservation system is used by hundreds of travel agents and reservation clerks submit transactions concurrently to the system.
Transaction States
The following are the different states in transaction processing in a dat system
- Active 2. Partially committed 3. Failed 4. Aborted
Active This is the initial state. The transaction stay in this state while it is executing.
Partially Committed This is the state after statement of the transaction is Executed..
Failed After the discovery that normal execution can no long proceed.
Aborted The state after the transaction has been rolled back and the database has been resorted to its state prior to the start o the transaction.
Isolation Levels
If every transaction does not make its updates visible to other transaction until it is committed, so isolation is enformed that solves the temporary
Update problem and eliminates cascading rollbacks.
There have been attempts to define the level of isolation of a transaction.
Level-0 Isolation A transaction is said to have level-0 isolation, if it does not overwrite the dirty reads of higher-level transactions.
Level-1 Isolation Level-1 isolation has no lost updates.
Level-2 Isolation Level-2 isolation has no lost updates and no dirty reads.
Level-3 Isolation Level-3 isolation (also true isolation) has repeatable reads.