Lost Update | Dirty Read | Unrepeatable Read | Phantom Read

Lost Update
丢失更新:提交或者回滚一个事务,把其它事务已提交的更新的数据覆盖了。
If the two transactions want to change the same columns, the second transaction will overwrite the first one, therefore losing the first transaction update.
这里写图片描述
In this example Bob is not aware that Alice has just changed the quantity from 7 to 6, so her UPDATE is overwritten by Bob’s change.

A lost update is a typical problem in transaction processing in SQL. It happens when two queries access and update the same data from a database. This problem can be understood by the below given diagram. Here, A is processing an order for a client for 150 items. He checks from the ITEMS table that there are 300 available items. So he starts placing the order. After few seconds B gets an order for 200 items. He also checks the items table and finds that there are 300 items available. So he also starts placing an order. Meanwhile,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值