简体   繁体   English

事务级别之间的差异:读可写和可隔离级别

[英]Differences between TRANSACTION's levels: READ WRITE and ISOLATION LEVEL SERIALIZABLE

What's the differences between these two transaction's levels: READ WRITE and ISOLATION LEVEL SERIALIZABLE ? 这两个事务级别之间的区别是: READ WRITEISOLATION LEVEL SERIALIZABLE As I understand, READ WRITE allows dirty reads, while ISOLATION LEVEL SERIALIZABLE prevents data from changing by other users(think that I'm mistaken here) or just read that data that is available at the beginning of the transaction(don't see the data, that has been changed by other users during my transaction). 据我了解, READ WRITE允许脏读,而ISOLATION LEVEL SERIALIZABLE可以防止其他用户更改数据(认为我在这里错了),或者只是读取在事务开始时可用的数据(看不到数据,在我进行交易时其他用户已更改了该数据)。

You can find detailed information about this topic on the oracle site . 您可以在oracle站点上找到有关此主题的详细信息。

Basically READ COMMITTED allows "nonrepeatable reads" and "phantom reads", while both are prohibited in SERIALIZABLE . 基本上, READ COMMITTED允许“不可重复读取”和“幻像读取”,而SERIALIZABLE均禁止。

If non-repeatable reads are permitted, the same SELECT query inside of the same transaction, might return different results based on when the query is issued. 如果允许不可重复读取,则同一事务内部的同一SELECT查询可能会根据发出查询的时间返回不同的结果。 Other parallel transactions may change the data and this changes might become visible inside your transaction. 其他并行事务可能会更改数据,并且此更改在您的事务内部可能会变得可见。

If phantom reads are permitted, it can happen that when you issue the same SELECT query twice inside of one transaction, and another transactions inserts rows into the table in parallel, these rows might become visible inside of your transaction, but only in the resultset of the second select. 如果允许幻像读取,则可能发生以下情况:当您在一个事务中两次发出相同的SELECT查询,而另一个事务并行地将行插入表中时,这些行可能在事务内部可见,但仅在第二选择。 So the same select statement will return for example 5 rows the first time and 10 rows the second time it was executed. 因此,同一条select语句将在第一次执行时返回例如5行,在第二次执行时返回10行。

Both properties are similar, but the first only says something about data which may change, while the scond property says something about additional rows which might be returned. 这两个属性是相似的,但第一个属性仅说明可能更改的数据,而scond属性则说明可能返回的其他行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM