declare _nextPid int;
declare _nextName varchar(20);
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
select ifnull(next_prop,0) from prop where pid=ipid into _nextPid;
select pname from prop where pid=_nextPid into _nextName;
if (_nextPid>0) then
update world_animal set pid=_nextPid,wname=_nextName,last_growup=now() where aid=iaid;
end if;
world_animal records:73959
aid is the primary key,i suppose with read committed should donnot lock whole table,
occasional,call pa_growup(82342,332) will get message:Lock wait timeout exceeded; try restarting transaction
but call pa_growup(82340,331) is work,
what wrong with my store procedure?
declare _nextName varchar(20);
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
select ifnull(next_prop,0) from prop where pid=ipid into _nextPid;
select pname from prop where pid=_nextPid into _nextName;
if (_nextPid>0) then
update world_animal set pid=_nextPid,wname=_nextName,last_growup=now() where aid=iaid;
end if;
world_animal records:73959
aid is the primary key,i suppose with read committed should donnot lock whole table,
occasional,call pa_growup(82342,332) will get message:Lock wait timeout exceeded; try restarting transaction
but call pa_growup(82340,331) is work,
what wrong with my store procedure?
Comment