在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. Python学习总结笔记

    # windows python -m http.server [<portNo>] # linux python -m SimpleHTTPServer [<portNo>] ...

  2. MariaDB 插入查询

    在本章中,我们将学习如何在表中插入数据. 将数据插入表需要INSERT命令. 该命令的一般语法是INSERT,后跟表名,字段和值. 查看下面给出的一般语法 - INSERT INTO tablenam ...

  3. vue实现前后台交互

    首先需要前台先安装一个包 cnpm install axios --save 第二还需要解决跨域问题 在settings中添加一条中间件 MIDDLEWARE = [“corsheders.middl ...

  4. DMA实验总结

    一.RCC设置 没什么好写的之前USART的基本一样 /************************************************************************ ...

  5. cf round#598 CDEF

    C:模拟:未跳到目的地之前先贪心放板子,能到达目的地后紧贴着放板子 先判能不能跳到目的地,能跳到再考虑是否需要将后面的板子往前移动 #include<bits/stdc++.h> usin ...

  6. lazy图片懒加载使用

    看到一个小伙子写的言简意赅很不错,摘录如下: https://www.npmjs.com/package/vue-lazyload 首先我们先在npm上下载vue-lazyload的包 1 npm i ...

  7. 回调函数 和 promise对象,及封装API接口

    1.回调函数:https://blog.csdn.net/baidu_32262373/article/details/54969696 注意:回调函数不一定需要用到 return.如果浏览器支持Pr ...

  8. 存储-docker数据共享(13)

    容器与 host 共享数据 我们有两种类型的 data volume,它们均可实现在容器与 host 之间共享数据,但方式有所区别. 对于 bind mount 是非常明确的:直接将要共享的目录 mo ...

  9. PHP使用引用变量foreach时,切记其他循环不要使用同一个名字的变量

    foreach ($log['data'] as $k => &$value) { if ($value['token'] != 0) { $value['change_num'] = ...

  10. 阿里云epel源

    epel是个好东西,不过国外的速度实在是不能忍受.所以 有了这篇文章.1. 首先卸载以前装的epel以免影响 rpm -e epel-release 2. 下载阿里提供的epel wget -P /e ...