トランザクション処理に関する記述のうち, 適切なものはどれか。
令和6年度 ITパスポート試験 問74
This question's explanation and your answers so far.
問 74
Incorrectア
The description “returning the database to the state before the start when a transaction is not processed normally” is the definition of a rollback, not a commit. A commit is the opposite: it is the operation that finalizes the updates when a transaction completes normally, so the descriptions have been swapped and this is incorrect.
Incorrectイ
The description “finalizing the contents of the database when it is processed normally” is the definition of a commit, not exclusive control. Exclusive control is a mechanism that prevents conflicts during concurrent access, which is different from finalizing contents, so it is incorrect.
Incorrectウ
The description “preventing data inconsistencies when multiple transactions try to update the same data at the same time” is the definition of exclusive control (such as locking), not a rollback. A rollback is the operation that returns to the state before the start when an abnormality occurs, so the descriptions have been swapped and this is incorrect.
- エ
正解 Choice エ is correct. A log (log file) is a file that records, in chronological order, the history of updates made to the database (when, which data, and how it was changed). When a transaction terminates abnormally or a failure occurs, this log can be used to perform a rollback (returning to the state before the update) or a roll-forward (advancing to the state after the update), so the database can be recovered to a correct state. Therefore, the description “a file that records the update history of the database” is appropriate as the definition of a log.
- Distinguish the correct correspondence between terms and definitions: commit = finalize updates on normal completion; rollback = return to the state before the start on an abnormality; exclusive control = prevent conflicts of concurrent updates; log = a file that records the update history.
- The log is the foundational file for failure recovery through rollback and roll-forward, and it underpins the atomicity and durability (ACID properties) of transactions.