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

  • From: Riyaj Shamsudeen <riyaj.shamsudeen@xxxxxxxxx>
  • To: fmhabash@xxxxxxxxx
  • Date: Wed, 25 Mar 2009 10:20:41 -0500

Hello fmhabash and Amar

   I think, it is not a good idea to use v$session or dbms_application_info.
Problem is that v$session is based upon x$ksuse. x$ tables are not protected
by usual consistent read mechanisms and rows are returned as pages are
browsed. So, it is quite possible for two sessions not to see each other,
running in to issues, however small the probability is.

  Especially, if this going to be called from multiple threads from a
program, then expect these threads not to see each other session.

   I read Amar's article also. I am not in complete agreement with that
article ( Of course, it is not fair to say that without providing some sort
of test case and so I will try to come up with a test case, however hard
that might be. )

-- 
Cheers

Riyaj Shamsudeen
Principal DBA,
Ora!nternals -  http://www.orainternals.com
Specialists in Performance, Recovery and EBS11i
Blog: http://orainternals.wordpress.com

On Wed, Mar 25, 2009 at 10:00 AM, FmHabash <fmhabash@xxxxxxxxx> wrote:

> I like this a lot. Will this work with connection pooling where physical
> connections are being reused.
>
>
> -----Original Message-----
> From: Amar Kumar Padhi <amar.padhi@xxxxxxxxx>
> Sent: Wednesday, March 25, 2009 12:01 AM
> To: oracle-l@xxxxxxxxxxxxx
> Subject: Re: Grabbing sequence values blocks in consecutive order: Need a
>     guaranteed method.
>
> Another method would be to make use of application locks to actually create
> serial access to sequences. This can be achieved by using
> dbms_application_info to update v$session and then referring this value for
> releasing resources to one session at a time. I have used this logic in
> different scenarios to avoid two sessions from using the same resource. has
> worked perfectly.
>
>
> http://www.databasejournal.com/features/oracle/article.php/3321961/Use-Oracles-DBMSAPPLICATIONINFO-to-Prevent-Routines-from-Running-Simultaneously.htm
>
> Thanks!
> Amar
> Www.amar-Padhi.com
>
> -original message-
> Subject: Re: Grabbing sequence values blocks in consecutive order: Need a
>     guaranteed method.
>
> --
> //www.freelists.org/webpage/oracle-l
>
>
>
> --
> //www.freelists.org/webpage/oracle-l
>
>
>

Other related posts: