0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

楽観ロック

0
Posted at

楽観ロック

排他制御の代表的な方式の一つ

排他制御

共有資源(ファイル)へのアクセスなどで競合が起こった時に、
同時書き込みによるデータの不整合などを防ぐために、
あるトランザクションがアクセス(編集)している時に他のトランザクションがアクセス(編集)
できないようにする仕組みの一つ。
他を排除する制御だから排他制御。

楽観ロックの仕組み

データそのものはロックしない(つまり閲覧やアクセス自体はできる)

バージョン情報等を持たせ、書き込み時にバージョンが最新状態かをチェックし、
最新状態のバージョンを取得していないデータのアクセスはロックされる。

これに対し、悲観ロックは閲覧やアクセス自体も制限する。

関連:悲観ロック、バージョン管理

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?