RE: Grabbing sequence values blocks in consecutive order: Need a guaranteed method.

  • From: "Bobak, Mark" <Mark.Bobak@xxxxxxxxxxxx>
  • To: "afatkulin@xxxxxxxxx" <afatkulin@xxxxxxxxx>, "riyaj.shamsudeen@xxxxxxxxx" <riyaj.shamsudeen@xxxxxxxxx>
  • Date: Wed, 25 Mar 2009 11:47:14 -0400

Agreed.  Nasty race condition.

Use DBMS_LOCK, that's what it's there for!!

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Alex Fatkulin
Sent: Wednesday, March 25, 2009 11:41 AM
To: riyaj.shamsudeen@xxxxxxxxx
Cc: fmhabash@xxxxxxxxx; amar.padhi@xxxxxxxxx; oracle-l@xxxxxxxxxxxxx
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

how about:

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

now what?

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
<riyaj.shamsudeen@xxxxxxxxx> wrote:
> 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
--
//www.freelists.org/webpage/oracle-l




--
//www.freelists.org/webpage/oracle-l


Other related posts: