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 等待资源释放,再执行。
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 等待资源释放,再执行。
转载于:https://www.cnblogs.com/zhangqiao0209/p/10650360.html