现在我要测试一个排他功能好不好用,除了批量更新,删除,添加外,还有没有其他的方法?

解决方案 »

  1.   

    打开几个会话.相互做update
    然后再相互试着update对方holder着的.
      

  2.   

    几个
    update without commit;
      

  3.   

    应该是update without commit;针对相同的表的相同的数据部分
      

  4.   

    比如说有2个拥护A,B  和 stu表(stuID,stuName)(2个用户都可以对表进行DML操作)
    --------------------------------------------
    用户A琐定stu表中stuID为1的信息
    select * from stu where stuid='1' for update ;
    --------------------------------------------
    用户B琐定stu表中stuID为2的信息
    select * from stu where stuid='2' for update ;
    --------------------------------------------
    用户A执行update stu set stuName='aa' where stuID='2';
    这样会被琐住;
    --------------------------------------------
    而用户B执行update stu set stuName='aa' where stuID='1';
    也都会被同样琐住。
    -------------------
    这样2个用户都不能操作了。
    之后死琐。-------
    小弟我是这样认为的。
    不同意见可以交流