mysql4.X的for update
来源:互联网 发布:淘宝上超好吃的零食 编辑:程序博客网 时间:2024/05/19 22:27
在MySQL中,可以使用select ... for update来锁定数据。不过这个用法有一些注意事项:
1) for update 是基于InnoDB的;
2) for update 必须在事务块中才能生效;
3) 由于InnoDB的预设值是 Row-Level Lock, 所以如果:
才能执行Row-Level Lock,否则会执行Table-Level Lock。
例如:
1) 明确指定主键,且有此记录;
select * from Table1 where PK_field=22 for update;
这样是Row-Level Lock;
2) 明确指定主键,且无此记录;
select * from Table1 where PK_field=22 for update;
这样是non-lock;
3) 不明确指定主键;
select * from Table1 where PK_field!=22 for update;
或者
select * from Table1 where PK_field like '22' for update;
这样是table-Level Lock;
- mysql4.X的for update
- mysql4.1.x的乱码问题
- 关于mysql4.0.X升级到mysql5.0的注意事项
- for update的作用
- for update的使用
- oracle的for update
- for update的意义
- Windows下PHP5.x+MYSQL4.1.x开发·工作环境的架设(5)
- Windows下PHP5.x+MYSQL4.1.x开发·工作环境的架设(6)
- for update和update nowait的区别
- Oracle的select for update
- oracle的select for update
- 关于for update的问题
- for update 的使用例子
- Oracle的 FOR UPDATE 行锁
- oracle 的for update行锁
- Oracle的For Update语句
- oracle for update 的使用
- 1 反射技术与设计模式
- VC++学习方法及书籍推荐(转)
- Tapestry 建立自己得 Validator
- 谈谈我对攻读计算机研究生的看法(转一个牛人文章)
- 将窗体嵌进panl或其它容器
- mysql4.X的for update
- 用 JDOM 简化 XML 编程
- 09年开始了......
- 成功秘诀
- 事
- 真正的中文版zend studio5.5.0
- 天意弄人?
- sdddddddddddddddddddddddddddd
- 什么是MVC框架