zoukankan      html  css  js  c++  java
  • 交易系统查询带上for update

    SESSION 1:
    
    SQL> select * from testmm;
    
       ID     AMOUNT
    ---------- ----------
        1      100
    
    SQL> update testmm set amount=amount * 1.1 where id=1;
    
    1 row updated.
    
    SQL> select * from testmm;
    
       ID     AMOUNT
    ---------- ----------
        1      110
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select * from testmm;
    
       ID     AMOUNT
    ---------- ----------
        1      110
        
        
    
    
    
    
    SESSION 2:
    [oracle@yyjk ~]$ sqlplus tlcbuser/tlcbuser
    
    SQL*Plus: Release 11.2.0.4.0 Production on ?..浜.4?.12 09:41:12 2019
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select * from testmm;
    
       ID     AMOUNT
    ---------- ----------
        1      100
    
    SQL> select * from testmm;
    
       ID     AMOUNT
    ---------- ----------
        1      100
    
    SQL> select * from testmm;
    
       ID     AMOUNT
    ---------- ----------
        1      100
    
    SQL>  update testmm set amount=amount * 1.1 where id=1;
    
    1 row updated.
    
    SQL> select * from testmm;
    
       ID     AMOUNT
    ---------- ----------
        1      121
        
  • 相关阅读:
    parted分区
    gitlab的还原
    hadoop2.7.3+spark2.0.1+scala2.11.8集群部署
    Daily record-September
    三次握手和四次挥手【转】
    “梅西式”程序员 【转】
    C++解析十-数据封装
    客户端、服务器代码实例
    网络整理
    C++解析九-数据抽象
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348799.html
Copyright © 2011-2022 走看看