Skip to content

平成23年度 秋期 ITパスポート試験 問63

This question's explanation and your answers so far.

問63
頻出度★☆☆

複数の利用者が同一データベースに同時にアクセスする処理のうち, データの整合性を保つための対策が不要な処理はどれか。

出典 平成23年度 秋期 ITパスポート試験 問63
解説

問 63

  • Incorrectア

    Bid processing for an auction is an update process that rewrites the current highest bid amount and the bid history for the same item on sale. If several users bid at almost the same time, both read the same highest amount from before the update and each writes it back, and a lost update in which one of the bids disappears from the record can occur. Exclusive control is also needed in order to determine the winning bidder uniquely, so this is not a process that requires no measures.

  • Incorrectイ

    Order application processing for online shopping involves not only registering the order data but also an update that decreases the stock quantity of the product. If several users order the last remaining item at the same time, both judge that stock is available and subtract at the same time, so the stock appears larger than it actually is or becomes a negative value, and consistency breaks down. Measures that place everything from checking the stock to updating it under exclusive control as a single transaction are indispensable, so this choice is wrong.

  • ウ

    正解 The correct answer is ウ. When multiple users access the same database at the same time, consistency (coherence) becomes a problem in the case where updates (writes) to the same data overlap. For example, if two people read the same data at the same time and each writes back a value based on what they read, the update made by the one who wrote first is overwritten by the one who wrote later and disappears. This is called a lost update, and to prevent it, exclusive control (locking) and concurrency control by means of transactions are needed. The search processing of book information in ウ only refers to already stored data using conditions such as the title or the author name, and it does not rewrite the contents of the database. If it is only reading, then no matter how many people run it at the same time they do not destroy each other's results, and reading the same data at the same time does not in itself produce a contradiction, so no measures are needed to maintain consistency. In fact, with the locks of a database management system, reads can acquire shared locks together at the same time and do not have to wait for each other, whereas an exclusive lock that accompanies an update makes other processes wait. From the above, the process that needs no measures is ウ, which only refers to data.

  • Incorrectエ

    Reservation processing for train seats is an update process that rewrites a specified seat as reserved. If several users try to reserve the same seat at the same time and no measures are taken, both judge the seat to be vacant and both reservations are established, producing the typical inconsistency of a double booking of the same seat. Checking that the seat is vacant and confirming the reservation must be made into one indivisible sequence of operations, and simultaneous updates must be prevented by exclusive control, so this does not fall under a process that requires no measures.

ここがポイント
  • The condition under which concurrency control becomes necessary — In simultaneous access to a database, consistency breaks down when updates (writes) to the same data conflict. Read-only processes do not destroy each other's data, so no measures are needed, while processes that involve an update require exclusive control (locking). Whether or not there is an update is the criterion that separates the choices.
  • Lost update and exclusive control — The phenomenon in which two processes read the same value and each writes it back, so that the earlier update disappears, is called a lost update. To prevent it, a series of operations is grouped together as a transaction and an exclusive lock is placed on the target of the update, making other processes wait. Shared locks for reading can be acquired at the same time, but an exclusive lock cannot be held together with any other lock.
用語

Your answers