Re: global context instead of for update or another idea ?

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 05 Sep 2008 07:38:45 -0700
Message-ID: <1220625525.376734@bubbleator.drizzle.com>


hopehope_123 wrote:
> Hi ,
>
> is it possible to use global variables in oracle? and is there any
> way to control concurrency on this memory variable?
>
> i can use a table, and read this by using for update. Under heavy
> loads, this will create contention.
>
> what else can i do?
>
> i try to use sequence data variable. there are multiple sessions.
> when one session reads next value, others must wait , and this
> creates contention also. and i need to use reuse values so
> sequence does not allow to use older values.
>
> synchronized methods of java do the same thing , can i do
> similiar thing in oracle? does global context provide this type of
> funcionality?
>
> kind regards,
> hope

In the sense that you seem to be asking the question global variables do not exist though one could kludge one together using AQ. Something I would definitely describe as a really bad idea.

What bothers me about your post is that you seem to think multiple sessions going for sequence.NEXTVAL creates contention. It doesn't unless you are doing something really terrible. Describe what it is you are doing as well as your version number (3 decimal places).

-- 
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Fri Sep 05 2008 - 09:38:45 CDT

Original text of this message