Re: Stupidity or sequences?

  • From: "Jonathan Lewis" <jonathan@xxxxxxxxxxxxxxxxxx>
  • To: "ORACLE-L" <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 23 Apr 2013 17:34:57 +0100

If you check the manuals about use of sequences you will find that
a) a session can't call currval for a sequence until after it has made at 
least one call to nextval
b) if two sessions use currval they will get different values - CURRVAL is 
not a "system wide" call.

It's not a 'latch' it's a latch - the standard serialisation mechanism that 
Oracle has been using all over the place for decades.

If sequence handling is anything like the typical library cache handling in 
Oracle the code to set and release the latch is part of the NEXTVAL code, 
and it probably serialises access to a hash table that leads to hash chains 
of in-memory sequence structures.


Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com/all-postings

Author: Oracle Core (Apress 2011)
http://www.apress.com/9781430239543

----- Original Message ----- 
From: "Dba DBA" <oracledbaquestions@xxxxxxxxx>
To: "ORACLE-L" <oracle-l@xxxxxxxxxxxxx>
Sent: Tuesday, April 23, 2013 3:05 PM
Subject: Re: Stupidity or sequences?


| ok. So CURRVAL won't actually serialize access to the object? 1 session 
can
| execute a CURRVAL and another can execute a NEXTVAL simulatenously? That
| makes sense. This tells me that the 'latch' is on the SET function and 
not
| on the struct itself. As far as the latching goes, I would guess it just
| uses the C language built in for this. I forget the syntax, but every low
| level language can serialize access.

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


Other related posts: