在Read Committed隔离级别下,一个事务可能会遇到不可重复读(Non Repeatable Read)的问题。

不可重复读是指,在一个事务内,多次读同一数据,在这个事务还没有结束时,如果另一个事务恰好修改了这个数据,那么,在第一个事务中,两次读取的数据就可能不一致。直线电机哪家好

我们仍然先准备好students表的数据:

mysql> select * from students;
+----+-------+
| id | name |
+----+-------+
| 1 | Alice |
+----+-------+
1 row in set (0.00 sec)

然后,分别开启两个MySQL客户端连接,按顺序依次执行事务A和事务B:

时刻 事务A 事务B
1 SET TRANSACTION ISOLATION LEVEL READ COMMITTED; SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
2 BEGIN; BEGIN;
3   SELECT * FROM students WHERE id = 1;
4 UPDATE students SET name = 'Bob' WHERE id = 1;  
5 COMMIT;  
6   SELECT * FROM students WHERE id = 1;
7   COMMIT;

Read Committed的更多相关文章

  1. Cannot forward after response has been committed

    项目:蒙文词语检索 日期:2016-05-01 提示:Cannot forward after response has been committed 出处:request.getRequestDis ...

  2. which type of VS files should be committed into a version control system

    which type of VS files should be committed into a version control system? aps, no: last resource edi ...

  3. when will a databasechange be committed?

    1) Database-updates via DML in a SQLExec-statement (e.g. INSERT INTO PS_TEST_TABLE VALUES(‘value_fie ...

  4. 报错:java.lang.IllegalStateException: Cannot call sendError() after the response has been committed(待解答)

    严重: Servlet.service() for servlet [default] in context with path [/20161101-struts2-1] threw excepti ...

  5. grails中报Cannot create a session after the response has been committed异常的解决办法

    在grails中,我们在layouts\main.gsp中使用类似如下的代码来判断当前用户处于登录状态时显示相关的登录信息: <g:if test="${session.users}& ...

  6. java.lang.IllegalStateException: Cannot call sendError() after the response has been committed

    http://blog.csdn.net/chenghui0317/article/details/9531171 —————————————————————————————————————————— ...

  7. Cannot call sendRedirect() after the response has been committed

    AJAX+JSP时,out.write('content')之后,如果后面还有代码,无法被执行到,会报 错,java.lang.IllegalStateException: Cannot call s ...

  8. Cannot call sendError() after the response has been committed - baiyangliu - 博客频道 - CSDN.NET

    body{ font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI& ...

  9. 【眼见为实】自己动手实践理解READ COMMITTED && MVCC

    [眼见为实]自己动手实践理解 READ COMMITTED && MVCC 首先设置数据库隔离级别为读已提交(READ COMMITTED): set global transacti ...

  10. java.lang.IllegalStateException: Cannot forward after response has been committed的一个情况解决方法

    java.lang.IllegalStateException: Cannot forward after response has been committed xxx.xxx.doPost(upd ...

随机推荐

  1. IDEA使用Maven搭建JavaWeb项目

    1. 新建项目 2. 填写项目坐标信息 3. 手动生效pom.xml 4. 添加maven常用配置 1) 设置项目统一编码 <!-- 设置编码 --> <properties> ...

  2. font-size-adjust属性定义及用法

    font-size-adjust属性定义及用法 在css中,font-size-adjust属性是使用来更好的控制字体大小,当第一个选择的字体不可用时,浏览器使用第二个指定的字体,这可能会导致改变字体 ...

  3. 网络-Docker 提供的几种原生网络和自定义网络(11)

    Docker 网络从覆盖范围可分为单个 host 上的容器网络和跨多个 host 的网络,本章重点讨论前一种 Docker 安装时会自动在 host 上创建三个网络,我们可用 docker netwo ...

  4. vue 微信公众号分享后支付失效页面URL不变的坑

    微信分享后支付页面还是初始页面,这个问题解决了, created(){ //判断是否是IOS设备 // IOS分享时的页面是首页,也就是进入页而不是当前页.所有可以采用刷新当前页,让进入页的链接改成当 ...

  5. 【Tomcat】使用Tomcat部署Spring Boot项目生成的jar包

    介绍 简单来说,Tomcat是一个免费的,用于Java Web应用以及其它Web应用的一个Web服务器.(简单地概括一下,可能有误) 下载与安装 本文章目标是把Spring Boot Web项目生成的 ...

  6. python 找到列表中满足某些条件的元素

    a = [0, 1, 2, 3, 4, 0, 2, 3, 6, 7, 5] selected = [x for x in a if x in range(1, 5)]   # 找到a中属于[1,5)中 ...

  7. PHP缓存技术相关

    全页面静态化缓存也就是将页面全部生成html静态页面,用户访问时直接访问的静态页面,而不会去走php服务器解析的流程.此种方式,在CMS系统中比较常见,比如dedecms:一种比较常用的实现方式是用输 ...

  8. Mysql create constraint foreign key faild.trouble shooting method share

    mysql> create table tb_test (id int(10) not null auto_increment primary key,action_id int(10) not ...

  9. upc组队赛3 T-net【贪心】

    T-net 题目描述 T-net which is a new telecommunications company, plans to install its base stations in th ...

  10. 获取项目根目录(非tomact)

    String path; public void main(String[] args) { File file=new File(""); path=file.getAbsolu ...