输入banner图图片脚本导航/分类

还是关于悲观锁的问题,begin与commit之间,可以有多个froupdate语句吗?

是不是可以这样 :
bgein;

select id from 表1 where id=1 for update;
select id from 表2 where id=1 for update;
select id from 表3 where id=1 for update;




update ok=1 set 表1 where id=1;
update ok=1 set 表2 where id=1;
update ok=1 set 表3 where id=1;

commit ;


回复讨论(解决方案)

是的可以,虽然 update 语句写错了(意思到了)

在此期间,其他的连接是不能 update 这几个表的

是的可以,虽然 update 语句写错了(意思到了)

在此期间,其他的连接是不能 update 这几个表的



多谢版主