hibernate isolation 幻读
来源:互联网 发布:华悦网络加速器怎么样 编辑:程序博客网 时间:2024/06/11 14:24
@transactional代表一个transaction
Isolation默认是
FAULT
Use the default isolation level of the underlying datastore.
如果用oracle 则默认的是In the read committed isolation level, which is the default
因为今天在同一个@transactional里面查询2次同样的对象,出现不同的结果,才知道产生了幻读
Nonrepeatable (fuzzy) reads
A transaction rereads data it has previously read and finds that another committed transaction has modified or deleted the data. For example, a user queries a row and then later queries the same row, only to discover that the data has changed.
Read Committed Isolation Level
In theread committed isolation level, which is the default, every query executed by a transaction sees only data committed before the query—not the transaction—began. This level of isolation is appropriate for database environments in which few transactions are likely to conflict.
注意是在query之前commit数据会看到,而不是transaction开始之前的数据,所有在@transactional中,query之前其他transaction修改后commit的数据都会看到,也就是我发现的问题
接着
A query in a read committed transaction avoids reading data that commits while the query is in progress. For example, if a query is halfway through a scan of a million-row table, and if a different transaction commits an update to row 950,000, then the query does not see this change when it reads row 950,000. However, because the database does not prevent other transactions from modifying data read by a query, other transactions may change databetween query executions. Thus, a transaction that runs the same query twice may experience fuzzy reads and phantoms.
就是在query读数据的过程中,如果其他transaction修改并提交了数据,正在查询的数据是看不到变化的,而且也不会阻止其他transaction修改,再次在该transaction查询就会发现和之前的数据不一样了,也就是幻读fuzzy reads
- hibernate isolation 幻读
- Isolation Level
- isolation level
- CPU Isolation
- Isolation Level
- Isolation level
- isolation forest
- Read Committed Snapshot Isolation和Snapshot Isolation
- Database-isolation levels
- SET TRANSACTION ISOLATION LEVEL
- innodb_locks_unsafe_for_binlog && transaction isolation level
- Transaction, Lock, Isolation Level
- SET TRANSACTION ISOLATION LEVEL
- ACID ISOLATION LEVEL
- oracle isolation level
- Transaction Isolation Level
- About AP Station Isolation
- Transaction Isolation Level
- poj 1742 硬币面值 拼凑 重解 poj 1014
- cakephp2 MeioUpload 图片上传简单应用
- ZOJ 3686 A A Simple Tree Problem
- hdu 1312 Red and Black(搜索)
- 一天一linux命令(11) ln 链接文件
- hibernate isolation 幻读
- jquery.fullCalendar官方文档翻译(一款小巧好用的日程管理日历, 可集成Google Calendar)
- Hibernate 查询多个字段返回的list如何转为自定义对象
- 怎样解题表
- 排序算法小结
- 根据文件编码格式解析html文件
- jrebel 使用
- Mysql SQL Mode简介
- Java 学习笔记——字符串