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: Matthew Nicoll <menicoll_at_mars.ark.com>
Date: Mon, 03 Jun 2002 16:20:56 GMT
Message-ID: <3cfb974b.1840656@news.ark.com>


Thanks for the smug help, gentlemen.

On Wed, 22 May 2002 15:03:32 GMT, Daniel Morgan <dmorgan_at_exesolutions.com> wrote:

>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 Mon Jun 03 2002 - 11:20:56 CDT

Original text of this message

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