LoginSignup
0
0

More than 3 years have passed since last update.

トランザクションとは

Last updated at Posted at 2020-01-14

IT用語トランザクションについて

複数の処理を1つにまとめたもの。
ただし、これら「複数の処理」は分離させることはできないこと。

具体例

  1. Aさんの口座から100円分差し引き、残高1,000 - 100 = 900円にする。
  2. Bさんの口座へ100円分プラスし、残高2,000 + 100 = 2100円にする。

1.の処理がうまくいって、2.の処理が何らかの原因で失敗したとする。そうなると、
Aさんの口座残高は5,000円になっているいる一方で、Bさんの口座残高は20,000円のままで、5000円が「消失」してしまうことになる。

まとめ

トランザクションは成功か失敗かの二択

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