Re: Stupidity or sequences?

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Tue, 23 Apr 2013 17:34:57 +0100
Message-ID: <9AE02D53F03D45C5B9058F648AC39B2A_at_Primary>


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_at_gmail.com> To: "ORACLE-L" <oracle-l_at_freelists.org> 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.

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Apr 23 2013 - 18:34:57 CEST

Original text of this message