Home » RDBMS Server » Performance Tuning » Locking of two sessions (Oracle, 10g,Windows)
Locking of two sessions [message #552691] Fri, 27 April 2012 06:17 Go to next message
manjumagesh
Messages: 1
Registered: April 2012
Junior Member
Want to know how to avoid oracle deadlock with two sessions. Here is my example, We use Select query with For Update in order to get the unique number from a table. When one user has accessed this query, while the other user tries, System gives a Performace slow and when checked it is due to locking of this select query with For update.

We don't want to use For update WAIT or FOR UPDATE NOWAIT since these will result in missing of number.

Kindly suggest me.
Re: Locking of two sessions [message #552692 is a reply to message #552691] Fri, 27 April 2012 06:20 Go to previous messageGo to next message
Michel Cadot
Messages: 58933
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There are only 2 options: either you lock and wait, either you don't lock and don't wait.
Which one do you want?

By the way, there is a major difference between wait on lock and dead lock, do you know it?

Regards
Michel
Re: Locking of two sessions [message #552698 is a reply to message #552691] Fri, 27 April 2012 07:17 Go to previous messageGo to next message
John Watson
Messages: 4514
Registered: January 2010
Location: Global Village
Senior Member
How about using
select ... from ... for update skip locked;

Re: Locking of two sessions [message #552700 is a reply to message #552698] Fri, 27 April 2012 07:24 Go to previous message
cookiemonster
Messages: 10923
Registered: September 2008
Location: Rainy Manchester
Senior Member
How would for update wait result in missing a number?
Previous Topic: Tablespace full warning
Next Topic: Lot of time being taken to delete the data from a table
Goto Forum:
  


Current Time: Fri Aug 29 01:08:01 CDT 2014

Total time taken to generate the page: 0.07619 seconds