Home » RDBMS Server » Server Administration » enq: TX - row lock contention (Oracle 10gr2 on solaris10)
icon5.gif  enq: TX - row lock contention [message #320725] Fri, 16 May 2008 01:46 Go to next message
chara
Messages: 81
Registered: April 2005
Location: th
Member
Hi all,

I have an example coding in my application as below :

select run_num from runnuma where parm1 = :param for update;
update runnuma set run_num = run_num + 1 where parm1 = :param ;
commit;

But i got row lock contention waiting around 30 mins. There are 300 rows of runnuma .
What happended? Does my logic or coding wrong?
Can anybody advise me?

PS: Oracle 10gr2 on solaris10
Thanks for advance
Chara
Re: enq: TX - row lock contention [message #320764 is a reply to message #320725] Fri, 16 May 2008 03:34 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
What happended?

Someone else is also updating the same row.
Quote:
Does my logic or coding wrong?
Can anybody advise me?

Just update you don't need to previously select for update.

Regards
Michel
icon5.gif  Re: enq: TX - row lock contention [message #320792 is a reply to message #320725] Fri, 16 May 2008 04:45 Go to previous messageGo to next message
chara
Messages: 81
Registered: April 2005
Location: th
Member
Thank you for your response !
If i want locked the row that i want to update How can i protect this row ?(I don't want anybody to take action this row)
Lock table?

Pls explainme.

Thank you
Chara
Re: enq: TX - row lock contention [message #320798 is a reply to message #320792] Fri, 16 May 2008 04:54 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
If i want locked the row that i want to update How can i protect this row ?(

UPDATE itself locks the row.

Regards
Michel
Previous Topic: Cannot drop DEF$_AQCALL
Next Topic: rollback segs
Goto Forum:
  


Current Time: Fri Nov 29 22:54:06 CST 2024