RE: Grabbing sequence values blocks in consecutive order: Need a guaranteed method.
Date: Wed, 25 Mar 2009 11:47:14 -0400
Agreed. Nasty race condition.
Use DBMS_LOCK, that's what it's there for!!
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Alex Fatkulin Sent: Wednesday, March 25, 2009 11:41 AM To: riyaj.shamsudeen_at_gmail.com
Cc: fmhabash_at_gmail.com; amar.padhi_at_gmail.com; oracle-l_at_freelists.org Subject: Re: Grabbing sequence values blocks in consecutive order: Need a guaranteed method.
Riyaj -- I don't like that article either.
the example in that article is dangerous at best
reading and setting module are not an atomic instructions
T1: am_dep1 check for am_dep2 -- not running, gets preempted by the OS before it sets itself
T2: am_dep2 check for am_dep1 -- not running T3: am_dep2 registers itself and starts running T4: am_dep1 gets into run queue again and registers itself and starts running
not even mention that on SMP system both processes might checks the status at the same time with the same outcome...
On Wed, Mar 25, 2009 at 11:20 AM, Riyaj Shamsudeen
> Hello fmhabash and Amar
> I think, it is not a good idea to use v$session or dbms_application_info.
-- Alex Fatkulin, http://afatkulin.blogspot.com http://www.linkedin.com/in/alexfatkulin -- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-lReceived on Wed Mar 25 2009 - 10:47:14 CDT