zoukankan      html  css  js  c++  java
  • RR 插入不影响

    | test100 | CREATE TABLE `test100` (
      `sn` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增编号',
      `phoneNo` int(11) DEFAULT NULL,
      `channelType` int(11) DEFAULT NULL COMMENT '通道识别',
      `status` tinyint(4) NOT NULL COMMENT '短信转态,1.发送成功,2.发送失败,3.发送异常',
      PRIMARY KEY (`sn`),
      KEY `test100_idx1` (`phoneNo`)
    ) ENGINE=InnoDB AUTO_INCREMENT=5028 DEFAULT CHARSET=utf8 COMMENT='短信发送成功记录表'                                  |
    +---------
    
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    -----------------------------------------+
    1 row in set (0.02 sec)
    
    
    mysql> select * from test100 limit 20;
    +----+---------+-------------+--------+
    | sn | phoneNo | channelType | status |
    +----+---------+-------------+--------+
    |  1 |       1 |           2 |      1 |
    |  2 |       2 |           2 |      1 |
    |  3 |       3 |           2 |      1 |
    |  4 |       4 |           2 |      1 |
    |  5 |       5 |           2 |      1 |
    |  6 |       6 |           2 |      1 |
    |  7 |       7 |           2 |      1 |
    |  8 |       8 |           2 |      1 |
    |  9 |       9 |           2 |      1 |
    | 10 |      10 |           2 |      1 |
    | 11 |      11 |           2 |      1 |
    | 16 |      16 |           2 |      1 |
    | 17 |      17 |           2 |      1 |
    | 18 |      18 |           2 |      1 |
    | 19 |      19 |           2 |      1 |
    | 20 |      20 |           2 |      1 |
    | 21 |      21 |           2 |      1 |
    | 22 |      22 |           2 |      1 |
    | 23 |      23 |           2 |      1 |
    | 24 |      24 |           2 |      1 |
    +----+---------+-------------+--------+
    20 rows in set (0.00 sec)
    
    
    
    
    Session 1:
    
    
    mysql> select * from test100 limit 20;
    +----+---------+-------------+--------+
    | sn | phoneNo | channelType | status |
    +----+---------+-------------+--------+
    |  1 |       1 |           2 |      1 |
    |  2 |       2 |           2 |      1 |
    |  3 |       3 |           2 |      1 |
    |  4 |       4 |           2 |      1 |
    |  5 |       5 |           2 |      1 |
    |  6 |       6 |           2 |      1 |
    |  7 |       7 |           2 |      1 |
    |  8 |       8 |           2 |      1 |
    |  9 |       9 |           2 |      1 |
    | 10 |      10 |           2 |      1 |
    | 11 |      11 |           2 |      1 |
    | 16 |      16 |           2 |      1 |
    | 17 |      17 |           2 |      1 |
    | 18 |      18 |           2 |      1 |
    | 19 |      19 |           2 |      1 |
    | 20 |      20 |           2 |      1 |
    | 21 |      21 |           2 |      1 |
    | 22 |      22 |           2 |      1 |
    | 23 |      23 |           2 |      1 |
    | 24 |      24 |           2 |      1 |
    +----+---------+-------------+--------+
    20 rows in set (0.00 sec)
    
    mysql> SELECT @@tx_isolation;
    +-----------------+
    | @@tx_isolation  |
    +-----------------+
    | REPEATABLE-READ |
    +-----------------+
    1 row in set (0.01 sec)
    
    mysql> start transaction;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> insert into test100(phoneNo,channelType,status) values(15,1,1);
    Query OK, 1 row affected (0.05 sec)
    
    
    
    Session 2:
    mysql> use zjzc;
    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>  insert into test100(phoneNo,channelType,status) values(15,1,1);
    Query OK, 1 row affected (0.01 sec)
    
    mysql>  insert into test100(phoneNo,channelType,status) values(14,1,1);
    Query OK, 1 row affected (0.01 sec)
    
    mysql>  insert into test100(phoneNo,channelType,status) values(16,1,1);
    Query OK, 1 row affected (0.00 sec)

  • 相关阅读:
    Andorid手机振动器(Vibrator)的使用
    Log.i()的用法
    刀哥多线程现操作gcd-10-delay
    刀哥多线程全局队列gcd-09-global_queue
    刀哥多线程Barrier异步gcd-08-barrier_async
    刀哥多线程同步任务作用gcd-07-sync_task
    刀哥多线程之主队列gcd-06-main_queue
    刀哥多线程之并发队列gcd-05-dispatch_queue_concurrent
    刀哥多线程串行队列gcd-04-dispatch_queue_serial
    刀哥多线程之03GCD 常用代码
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199067.html
Copyright © 2011-2022 走看看