Path: text.usenetserver.com!out03b.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!postnews.google.com!e10g2000prf.googlegroups.com!not-for-mail
From: Steve Howard <stevedhoward@gmail.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: (Java) Synchronizing multiple app servers through Oracle
Date: Wed, 12 Dec 2007 18:16:18 -0800 (PST)
Organization: http://groups.google.com
Lines: 48
Message-ID: <f7e07638-9677-4768-a688-4c4559ff4174@e10g2000prf.googlegroups.com>
References: <b6bd3517-2b62-4e70-bdc8-c8ab4de95261@a35g2000prf.googlegroups.com> 
 <905e4f99-e729-4d84-90e8-378a997357cb@b40g2000prf.googlegroups.com> 
 <891f1536-701e-4046-8769-96c5662ec7ed@b40g2000prf.googlegroups.com>
NNTP-Posting-Host: 75.118.5.89
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1197512178 4999 127.0.0.1 (13 Dec 2007 02:16:18 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 13 Dec 2007 02:16:18 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: e10g2000prf.googlegroups.com; posting-host=75.118.5.89; 
 posting-account=wtlN5gkAAAAVr064jxzGl8R72LkgvhF6
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) 
 Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe)
Xref: usenetserver.com comp.databases.oracle.server:439017
X-Received-Date: Wed, 12 Dec 2007 21:16:18 EST (text.usenetserver.com)

On Dec 12, 9:04 pm, chrism...@gmail.com wrote:
> On Dec 12, 8:33 pm, Steve Howard <stevedhow...@gmail.com> wrote:
>
>
>
> > On Dec 12, 8:10 pm, chrism...@gmail.com wrote:
>
> > > What is the recommended way for using an Oracle database to
> > > synchronize multiple app servers?  When I speak of synchronizing, I'm
> > > referring to the Java use of the word, where you can lock a section of
> > > code so other threads don't access that section at the same time.
>
> > > I have multiple app servers that each need exclusive access to the
> > > database for a certain operation.  Does Oracle have a semaphore
> > > utility that is available to apps?  I know I could hack it by doing a
> > > select for update on a dummy table with 1 row, but I was hoping Oracle
> > > had something more elegant to use.
>
> > > Thanks.
>
> > Hi,
>
> > Oracle locks rows by default (it doesn't matter if it's java, C#, VB,
> > C, SQL*Plus, etc.), but I don't know what you mean "exclusive access
> > to the database for a certain operation".  If you have a need for more
> > sophisticated application locking, look into the procedures in the
> > dbms_lock package at tahiti.oracle.com
>
> > HTH,
>
> > Steve
>
> dbms_lock sounds like exactly what I'm looking for.  It doesn't appear
> to be part of Oracle 10g (the version I'm using).  Is it downloadable
> from the Oracle web site?  I didn't find it my first try.
>
> Thanks.

AFAIK, dbms_lock is part of the standard installation.

In SQL*PLus, type desribe dbms_lock to see if it is already installed.

If it not in your database for whatever reason, it can be installed by
running dbmslock.sql under $ORACLE_HOME/rdbms/admin

HTH,

Steve
