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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Is it possible to use nolock type of hint in query

Re: Is it possible to use nolock type of hint in query

From: Jared Still <jkstill_at_gmail.com>
Date: Mon, 14 Aug 2006 10:49:58 -0700
Message-ID: <bf46380608141049w654ab2b9n68f9807c7634deb2@mail.gmail.com>


On 8/14/06, Norman Dunbar <norman.dunbar_at_environment-agency.gov.uk> wrote:
>
>
> Dave Ensor's book about Oracle Design has a good chapter on this very
> subject, which basically boils down to 'lock late and lock for a short
> time only'. SELECT ... FOR UPDATE is a 'lock early and lock for as long
> as possible' technique.
>
>

I don't see how that invalidates the use of SELECT FOR UPDATE.

The key is when to use it.

Query data at the beginning of the transaction.

This obviously must be stored somewhere. PLSQL tables come to mind. It depends on the size of the transaction I guess.

Let the user modify data as needed.

When the user is ready to commit the transaction:

This leaves the row(s) locked just long enough for the app to determine if it is safe to proceed.

I believe that Oracle Forms does something like this.

The problem seems to be (as with many things involving databases) the misuse of the SELECT FOR UDPATE statement.

-- 
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Aug 14 2006 - 12:49:58 CDT

Original text of this message

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