Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Is it possible to use nolock type of hint in query
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-lReceived on Mon Aug 14 2006 - 12:49:58 CDT
![]() |
![]() |