oracle行级锁 (select for update)

1.适用条件

当查询某些记录时候,不希望其他用户对此记录进行修改;

2.适用方法

  select  a.code,a.name from  store a  where code='0173' for update;

  rollback /commit ;    ----解除锁定

3.for update nowait  与for  update 区别

 for  update nowait  不会等待资源释放,直接提示资源占用;

for  update  等待资源释放,再执行。

 

posted @ 2019-04-03 17:34  张巧便  阅读(2611)  评论(0编辑  收藏  举报