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

I agree as well, the process in the article is not safe.

In theory, you could use DBMS_LOCK to serialize the check if running,
but why bother when you can just use DBMS_LOCK .

-- 
Christo Kutrovsky
Senior DBA
The Pythian Group - www.pythian.com
I blog at http://www.pythian.com/blogs/


On Wed, Mar 25, 2009 at 11:40 AM, Alex Fatkulin <afatkulin@xxxxxxxxx> wrote:
> 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
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>



-- 
Christo Kutrovsky
Senior DBA
The Pythian Group - www.pythian.com
I blog at http://www.pythian.com/blogs/
--
http://www.freelists.org/webpage/oracle-l


Other related posts: