不可重复读与脏读之间的区别 [英] Difference between non-repeatable read vs dirty read

查看:160
本文介绍了不可重复读与脏读之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自 Oracle Java教程:

From this oracle java tutorial:

当事务A检索行时,将发生不可重复的读取, 事务B随后更新该行,事务A随后更新 再次检索同一行.事务A检索同一行 两次,但看到不同的数据.

A non-repeatable read occurs when transaction A retrieves a row, transaction B subsequently updates the row, and transaction A later retrieves the same row again. Transaction A retrieves the same row twice but sees different data.

脏读和不可重复读之间有什么区别?是不是同一回事?由于其他人的更新而读取了错误的结果?

What's the difference between a dirty read and the non-repeatable read? Is it not the same thing? reading the wrong result due to others' updating?

谢谢.

推荐答案

完全相同的页面解释了什么是脏读:

The exact same page explains what a dirty read is:

访问尚未提交的更新值被视为脏读,因为该值可能会回滚到其先前的值.如果您读取的某个值稍后又会回滚,则您将读取一个无效的值.

Accessing an updated value that has not been committed is considered a dirty read because it is possible for that value to be rolled back to its previous value. If you read a value that is later rolled back, you will have read an invalid value.

因此,不可重复读包含读取两个不同的提交值,而脏读包含读取尚未提交的值.完全不同.

So, non-repeatable read consists in reading two different committed values, whereas dirty read consists in reading a value that hasn't been committed yet. Quite different.

这篇关于不可重复读与脏读之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆