Correct option is B
When a transaction is in the
active state, its next possible transition depends on its execution outcome. If an error occurs during execution, it transitions to the
failed state (A). If it executes successfully, it transitions to the
partially committed state (C).
Information Booster
1.
Transaction States:
·
Active State: The initial state of a transaction where it is being executed.
·
Partially Committed State (C): Reached when a transaction completes its final statement successfully, but before ensuring the data is written permanently to the database.
·
Failed State (A): Entered when a transaction cannot complete due to errors (e.g., system crash, logical error).
·
Committed State (D): Reached after a transaction’s changes are permanently written to the database.
·
Terminated State (B): The final state after a transaction ends successfully (commit) or fails and rolls back.
2.
Possible Transitions:
· From
Active State, the transaction can:
· Transition to
Failed State (A) if it encounters an error.
· Transition to
Partially Committed State (C) if it successfully executes all instructions.
Additional Knowledge
·
ACID Properties: Ensure transaction consistency, particularly in the event of system crashes or concurrent execution.
·
Concurrency Control: Helps manage the state transitions of multiple transactions to avoid conflicts.
· Real-world applications of transaction states include database operations in banking, reservations, and e-commerce systems.
·
A only: Incorrect because the transaction can also transition to the partially committed state.
·
C only: Incorrect because a transaction might fail and transition to the failed state.
·
D only: Incorrect because a transaction does not directly transition from active to committed; it must first enter the partially committed state.