Page 91 - CITS - Computer Software Application -TT
P. 91
COMPUTER SOFTWARE APPLICATION - CITS
Transactions in database management systems (DBMS) have several key properties that define their behavior
and ensure data integrity. These properties are often referred to as the ACID properties:
1 Atomicity (A): Atomicity ensures that a transaction is treated as a single, indivisible unit of work.
It follows the “all or nothing” principle, meaning that all the operations within a transaction are either fully
completed or fully undone in case of an error or failure.
If any part of the transaction fails, the entire transaction is rolled back, and the database remains unchanged.
Atomicity ensures that the database remains in a consistent state.
2 Consistency (C): Consistency guarantees that a transaction brings the database from one valid state to
another valid state.
This means that a transaction must adhere to all integrity constraints, rules, and validations defined in the
database schema.
If a transaction violates consistency rules, it is rolled back, and the database remains unchanged. Consistency
ensures that data remains in a coherent state during and after the transaction.
3 Isolation (I): Isolation defines the degree to which one transaction is isolated from the effects of other
concurrent transactions.
It ensures that concurrent transactions do not interfere with each other and maintains data integrity.
Different isolation levels (e.g., Read Uncommitted, Read Committed, Repeatable Read, Serializable) specify
the level of isolation between concurrent transactions.
Higher isolation levels provide stronger guarantees but may impact performance due to locking and resource
contention.
4 Durability (D): Durability guarantees that once a transaction is committed, its effects are permanent and will
survive any subsequent system failures, such as power outages, crashes, or hardware failures.
This is typically achieved by writing transaction changes to non-volatile storage (e.g., disk) and maintaining a
transaction log for recovery purposes. Durability ensures data persistence and reliability.
These ACID properties collectively provide a framework for ensuring the reliability, consistency, and integrity
of database transactions, even in complex and concurrent environments. They are essential in applications
where data accuracy is critical, such as financial systems, e-commerce platforms, and any scenario where
data integrity is paramount. Transactions that adhere to the ACID properties can be trusted to maintain data
integrity and consistency.
States of Transaction
Transactions in a database management system (DBMS) go through various states during their lifecycle. These
states represent the progress and outcome of a transaction. The common states of a transaction include:
1 Active (or Running): The transaction is in the active state when it is executing its operations. During this
phase, the transaction is interacting with the data base, reading, and writing data. It may issue one or more
SQL statements.
2 Partially Committed (or Preparing): After the transaction has executed its operations successfully, it enters
the partially committed state. In this state, the DBMS prepares to make the changes permanent but has not
yet committed the transaction. The system ensures that all necessary conditions are met before moving to the
committed state.
3 Committed: In the committed state, the transaction has been successfully completed, and all its changes
have been made permanent in the database. Once a transaction is committed, its changes are considered
permanent and cannot be undone.
4 Aborted (or Rolled Back): If an error occurs during the execution of the transaction or if the transaction
encounters a condition that causes it to fail, it may enter the aborted state. In this state, the transaction is rolled
back, which means that any changes it made to the database are undone, and the database is restored to its
previous state.
78
CITS : IT&ITES - Computer software application - Lesson 18 - 36