金融システムの口座振替では, 振替元の口座からの出金処理と振替先の口座への入金処理について, 両方の処理が実行されるか, 両方とも実行されないかのどちらかであることを保証することによってデータベースの整合性を保っている。データベースに対するこのような一連の処理をトランザクションとして扱い, 矛盾なく処理が完了したときに, データベースの更新内容を確定することを何というか。
令和3年度 ITパスポート試験 問62
This question's explanation and your answers so far.
問 62
- ア
正解 The correct answer is ア, Commit. When the series of update operations performed in a transaction completes all the way through without inconsistency, the operation that officially reflects and finalizes those updates into the database is called a commit. In the account-transfer example, committing at the point when both the debit processing and the credit processing have finished without problems finalizes the updates, and from then on the result becomes effective. Conversely, if an abnormality occurs midway, cancelling the updates (a rollback) guarantees that “either both are executed or neither is executed”, thereby preserving the database's consistency. The “finalizing the update content” that the question asks about matches exactly the definition of commit.
Incorrectイ
A schema is a term referring to the definition of a database's structure (such as table fields, data types, and constraints); it is not an operation that finalizes transaction updates, so it is incorrect.
Incorrectウ
Rollforward is an operation that, after a failure occurs, uses a backup and the after-update log (journal) to reproduce already-committed updates and thereby recover the database; it is not the operation that finalizes update content during normal processing, so it is incorrect.
Incorrectエ
A lock is an exclusive-control mechanism that makes other processes wait while data is in use, so that multiple processes accessing the same data at the same time do not cause inconsistency; it is not an operation that finalizes updates, so it is incorrect.
- A commit is the operation that finalizes and reflects the update content into the database when a transaction's series of updates completes normally (its opposite is rollback, which cancels the updates).
- A transaction guarantees that “either everything is executed or nothing is executed at all” (atomicity), and it maintains database consistency through commit and rollback.