ORACLE FOR UPDATE与FOR UPDATE OF区别
来源:互联网 发布:linux 线程 sleep 编辑:程序博客网 时间:2024/06/04 19:32
先看几个例子:
1.select * from Table for update --锁定表的所有行,只能读不能写
2.select * from Table where pkid = 1 for update --只锁定pkid=1的行
3.select * from Table a join Table b on a.pkid=b.pkid for update-- 锁定两个表的所有记录
4.select * from Table a join Table b on a.pkid=b.pkid where a.pkid = 10 for update --锁定两个
5. select * from Table1 a join Table b on a.pkid=b.pkid where a.pkid = 10 for update of a.pkid 只锁定Table1中满足条件的行
for update 是把所有的表都锁点 for update of 根据of 后表的条件锁定相对应的表
第一点:
第二点:关于NOWAIT(如果一定要用FOR UPDATE,我更建议加上NOWAIT)
“使用FOR UPDATE WAIT”子句的优点如下:
1.防止无限期地等待被锁定的行;
2.允许应用程序中对锁的等待时间进行更多的控制。
3.对于交互式应用程序非常有用,因为这些用户不能等待不确定
4.若使用了skip locked,则可以越过锁定的行,不会报告由wait n 引发的‘资源忙’异常报告
http://blog.sina.com.cn/s/blog_61cd89f60102e7di.html
- oracle 中 for update与for update of的区别
- ORACLE FOR UPDATE与FOR UPDATE OF区别
- oracle-for update 与 for update of
- oracle-for update 与 for update of
- For Update 与 For Update of 区别
- 数据库oracle for update of 和for update的区别
- 数据库 oracle for update of 和 for update区别
- 数据库oracle for update of和for update区别
- 数据库 oracle for update of 和 for update区别【经典】
- 数据库 oracle for update of 和 for update区别【经典】
- 数据库 oracle for update of 和 for update区别
- 数据库 oracle for update of 和 for update区别
- oracle for update 和 for update of的区别
- 数据库oracle for update of和for update区别
- 数据库 oracle for update of 和 for update区别【经典】
- 数据库oracle for update of和for update区别
- 数据库oracle for update of和for update区别
- oracle for update of和for update区别
- Socket类的用法
- ios6新特性之下拉刷新UIRefreshControl
- 初步实现最长回文子串
- Ubuntu 14.04 安装配置 JDK8
- jquery事件委托
- ORACLE FOR UPDATE与FOR UPDATE OF区别
- Ubuntu下安装mysql5.6
- 检测用户拖动ScrollView速度
- ZOJ 3328(思维)
- Unity 3D——打包复用资源(.unitypackage文件)
- 多线程并发编程(一):传统多线程实现方式
- C#中方法参数的类型
- Tomcat、MySQL注意
- 在 Windows 安裝 PHP PEAR