Sesssion 1:
mysql> select @@tx_isolation;
+-----------------+
| @@tx_isolation |
+-----------------+
| REPEATABLE-READ |
+-----------------+
1 row in set (0.00 sec) mysql> use scan;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> start transaction;
Query OK, 0 rows affected (0.00 sec) mysql> select * from t1;
+-------+
| c1 |
+-------+
| 33 |
| 34 |
| 87 |
| 89 |
| 100 |
| 999 |
| 88888 |
+-------+
7 rows in set (0.00 sec) Session 2:
mysql> select @@tx_isolation;
+-----------------+
| @@tx_isolation |
+-----------------+
| REPEATABLE-READ |
+-----------------+
1 row in set (0.00 sec) mysql> use scan;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> start transaction;
Query OK, 0 rows affected (0.00 sec) mysql> select * from t1;
+-------+
| c1 |
+-------+
| 33 |
| 34 |
| 87 |
| 89 |
| 100 |
| 999 |
| 88888 |
+-------+
7 rows in set (0.00 sec) mysql> insert into t1 values(909090);
Query OK, 1 row affected (0.00 sec) mysql> commit;
Query OK, 0 rows affected (0.01 sec) Session 1再次查看:
mysql> select * from t1;
+-------+
| c1 |
+-------+
| 33 |
| 34 |
| 87 |
| 89 |
| 100 |
| 999 |
| 88888 |
+-------+
7 rows in set (0.00 sec) Session 1看不到 909090这条记录 切换到RC模式:
transaction-isolation =READ-COMMITTED Session 1:
mysql> select @@tx_isolation;
+----------------+
| @@tx_isolation |
+----------------+
| READ-COMMITTED |
+----------------+
1 row in set (0.00 sec) mysql> use scan;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> start transaction;
Query OK, 0 rows affected (0.00 sec) mysql> select * from t1;
+--------+
| c1 |
+--------+
| 33 |
| 34 |
| 87 |
| 89 |
| 100 |
| 999 |
| 88888 |
| 909090 |
+--------+
8 rows in set (0.00 sec) Session 2:
mysql> use scan;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> start transaction ;
Query OK, 0 rows affected (0.00 sec) mysql> select @@tx_isolation;
+----------------+
| @@tx_isolation |
+----------------+
| READ-COMMITTED |
+----------------+
1 row in set (0.00 sec) mysql> insert into t1 values(98989800);
Query OK, 1 row affected (0.00 sec) mysql> commit;
Query OK, 0 rows affected (0.01 sec) Session 1: 再次查看: mysql> select * from t1;
+----------+
| c1 |
+----------+
| 33 |
| 34 |
| 87 |
| 89 |
| 100 |
| 999 |
| 88888 |
| 909090 |
| 98989800 |
+----------+
9 rows in set (0.00 sec) 可以看到98989800 这条记录

RR 和RC隔离问题的更多相关文章

  1. Mysql rr和rc隔离

    REPEATABLE READ This is the default isolation level for InnoDB. For consistent reads, there is an im ...

  2. MySQL--事务隔离级别RR和RC的异同

    在MySQL中,事务隔离级别RC(read commit)和RR(repeatable read)两种事务隔离级别基于多版本并发控制MVCC(multi-version concurrency con ...

  3. RR 和RC 幻读问题

    <pre name="code" class="html">显然 RR 支持 gap lock(next-key lock),而RC则没有gap l ...

  4. mysql rr和rc区别

    <pre name="code" class="html">1. 数据库事务ACID特性 数据库事务的4个特性: 原子性(Atomic): 事务中的 ...

  5. 【MySQL 读书笔记】RR(REPEATABLE-READ)事务隔离详解

    这篇我觉得有点难度,我会更慢的更详细的分析一些 case . MySQL 的默认事务隔离级别和其他几个主流数据库隔离级别不同,他的事务隔离级别是 RR(REPEATABLE-READ) 其他的主流数据 ...

  6. RR和RC复合语句加锁

    mysql版本:5.7 RR复合语句: insert/update/delete+select,+号左边是影响数据的排他锁,+号右边是查询(当前读,其实相当于lock in share mode)到数 ...

  7. RC隔离 更新where条件列 没有索引的情况

    CREATE TABLE `test100` ( `sn` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增编号', `phoneNo` int(11) , `c ...

  8. 一文彻底读懂MySQL事务的四大隔离级别

    前言 之前分析一个死锁问题,发现自己对数据库隔离级别理解还不够清楚,所以趁着这几天假期,整理一下MySQL事务的四大隔离级别相关知识,希望对大家有帮助~ 事务 什么是事务? 事务,由一个有限的数据库操 ...

  9. 浅谈mysql mvcc

    以下为个人理解,如有错误,还望指正!! mysql的大多数事务型存储引擎实现的都不是简单的行级锁,基于提升并发性能的考虑,他们一般都同时实现了多版本并发控制,可以认为MVCC是行级锁的一个变种,但是它 ...

随机推荐

  1. jni java和C之间的值传递(int String int[])

    我们通过jni调用C代码不可能每次只是去调一个方法,通常,我们需要传递一些值过去. 例如,播放电影,那就肯定需要你把电影的 url给 C的播放器吧,等等. 接下来就看一看怎么去传递这些值: 首先是最简 ...

  2. [PWA] 6. Hijacking response

    For example, if the url is not match to any API endpoint, we want to return 404 error message. So fi ...

  3. qt 关于内存泄漏的检测

    Qt 关于内存泄露的检测: 收藏人:guitarhua     2012-02-10 | 阅:  转:    |   来源   |  分享               Qt 关于内存泄露的检测:工具篇 ...

  4. Unity3d Awake、OnEnable、Start生命周期

    Unity3d,Awake.OnEnable.Start,都是游戏开始运行前,所运行的方法. GameObject的Activity为true,脚本的enable为true时,其先后顺序为:Awake ...

  5. Python之路,Day26-----暂无正在更新中

    Python之路,Day26-----暂无正在更新中

  6. Android 连接 SQL Server (jtds方式)——上

    本文将介绍开发Android程序,连接SQL Server,通过第三方包jtds的方式. 如果你有同样的需求,请跟着做一遍,博主将以最详细的方式,进行介绍. 首先说明,Java.Android连接SQ ...

  7. LINQ的基本用法

    1.var q =from c in db.Customers select c.ContactName; 这个语句只是一个声明或者一个描述,并没有真正把数据取出来,只有当你需要该数据的时候,它才会执 ...

  8. java学习第一阶段——面向对象

    你聪明有人会说你心机重, 你靠的是努力有人会说你运气好, 你说自己天生乐观有人会说你虚假, 有时候, 你明明就是一杯白水, 却被人硬生生逼成了满肚子憋屈的碳酸饮料. 人一生要遇见太多人, 即使有些话字 ...

  9. webservice调用接口,接口返回数组类型

    1. 其中sendSyncMsg1接口是方法名,Vector实现了List接口,xml是sendSyncMsg1的方法形参 Service service = new Service(); Call ...

  10. XML约束图解