A logical unit of work that performs one or more database operations (reads/writes). Ensures ACID properties. Consistency might be temporarily lost while a transaction is running. Multiple transactions can run in parallel.
Transaction States
Section titled “Transaction States”| State | Description | Possible Next States |
|---|---|---|
| Active | Initial state. Executing. | Partially Committed, Failed |
| Partially Committed | Final operation done. Waiting to commit. | Failed, Committed |
| Failed | Error occurred. Cannot proceed normally. | Aborted |
| Aborted | Rolled back; database restored to previous state. | Active (if retrying) |
| Committed | Completed successfully. | - |
If the failure is temporary, can retry.