Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: CURRVAL in multi-user environments

Re: CURRVAL in multi-user environments

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 22 May 2002 15:03:32 GMT
Message-ID: <3CEBB337.636C0483@exesolutions.com>


Thomas Gaines wrote:

> Matt -
>
> This sounds simple enough to test. Give it a try and answer
> your own question...
>
> TG
>
> Matthew Nicoll wrote:
>
> > The Oracle documentation I have seen suggests I can define a sequence,
> > then use sequence_name.NEXTVAL for an ID for a parent row,
> > then use sequence_name.CURVAL in subsequent writes to child rows.
> >
> > In a multi-user environment, if the order of events is:
> > User 1 - NextVal gets 100
> > User 2 - NextVal gets 101
> > User 1 - CurrVal gets 100 or 101?
> >
> > I.e. is Oracle smart enough to keep a different CURRVAL for
> > each user?

Good advise. But consider this ... what happens to a variable in a procedure or package if more than one user is executing it at the same time? What happens to the results of a SELECT statement if two users are executing it at the same time?

I think the answer to your question is obvious if you give it some thought.

Daniel Morgan Received on Wed May 22 2002 - 10:03:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US