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: Locking Problem

RE: Locking Problem

From: Justin Cave <jcave_at_cableone.net>
Date: Fri, 13 Sep 2002 22:28:19 -0800
Message-ID: <F001.004D018F.20020913222819@fatcity.com>


At 10:53 AM 9/13/2002, you wrote:
>I could not understand. Can you please elaborate it.
>Do I need to introduce new table or it is already available with Oracle...
>I am not aware of MQ Series or AQ. Is this functionality available with
>Oracle.

MQ and AQ are queuing products. MQ is IBM's, AQ (Advanced Queuing) is an Oracle product-- I believe it's part of the Enterprise Edition.

A quick overview of your locking options-

#1 Select ... for update- This is the least scalable option and is generally frowned upon. When you do a select <some statement> for update, you lock every row that your query returns. Until you commit or rollback, no one else can update the rows. This is really unfortunate if a user goes home, takes a long lunch, etc. while they have records locked.

#2 Requery before commit- When a user is ready to commit their changes, the application will requery the database to see whether the data that's there is the same as it was when the user first asked for it. If not, the application will generally show the user the current state of the data and ask whether to overwrite, to throw away the changes, or to merge the changes (the application has to have to logic to figure out what it means to "merge")

As an aside, it sounds to me like you may have problems unrelated to locking. It sounds as if you are storing aggregate data like totals in tables rather than letting Oracle compute those. If you need to do that for performance reasons, I'd strongly suggest that you keep your aggregate data consistent by using triggers, not by relying on the application logic.

>Thanks
>Suman
>
>
>
> -----Original Message-----
> From: Gogala, Mladen [SMTP:MGogala_at_oxhp.com]
> Sent: Friday, September 13, 2002 9:28 PM
> To: Multiple recipients of list ORACLE-L
> Subject: RE: Locking Problem
>
> These things are usually resolved by queueing. There is
> a table into which users insert ("submit") their transactions
> and the background process takes care of it. There is also
> an output table ("status list") to which users can go to view
> whether there were any errors. It's usually done using MQ Series
> or AQ.
>
> > -----Original Message-----
> > From: Suman S K [mailto:SumanK_at_mascotsystems.com]
> > Sent: Friday, September 13, 2002 9:04 AM
> > To: Multiple recipients of list ORACLE-L
> > Subject: Locking Problem
> >
> >
> >
> > Hi Everybody,
> >
> >
> > I am facing problem while invoice Processing.
> >
> > We have Invoice_Header table and Invoice_Lines Table.
> >
> > One Record in Invoice_Header table can have multiple
> > related records
> > in Invoice_Lines.
> >
> > We have not implemented locking mechanism at header level.
>So
> > whenever two user working on same invoice it creates problem.
> >
> > Say One Invoice has 10 lines in Invoice_Lines Table and
> > first user
> > pressed the <Process Invoice> button. It does so many
> > validation and insert
> > records in subledger. Mean while another user can add new
> > lines in same
> > Invoice result is discrepancy in printed copy and system records.
> >
> >
> > Can anybody tell me how to resolve this issue.
> >
> >
> > Thanks
> > Suman
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > DISCLAIMER: Information contained and transmitted by this E-MAIL
>is
> > proprietary to Mascot Systems Limited and is intended for use
> > only by the
> > individual or entity to which it is addressed, and may
> > contain information
> > that is privileged, confidential or exempt from disclosure
> > under applicable
> > law. If this is a forwarded message, the content of this
> > E-MAIL may not have
> > been sent with the authority of the Company. If you are not
> > the intended
> > recipient, an agent of the intended recipient or a person
> > responsible for
> > delivering the information to the named recipient, you are
> > notified that any
> > use, distribution, transmission, printing, copying or
> > dissemination of this
> > information in any way or in any manner is strictly
> > prohibited. If you have
> > received this communication in error, please delete this mail
> > & notify us
> > immediately at Mailadmin_at_mascotsystems.com Before opening
>attachments,
> > please scan for viruses.
> >
> >
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > --
> > Author: Suman S K
> > INET: SumanK_at_mascotsystems.com
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858)
>538-5051
> > San Diego, California -- Public Internet access / Mailing
>Lists
> >
>--------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and
>in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You
>may
> > also send the HELP command for other information (like
>subscribing).
> >
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Gogala, Mladen
> INET: MGogala_at_oxhp.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing
>Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
>
>DISCLAIMER: Information contained and transmitted by this E-MAIL is
>proprietary to Mascot Systems Limited and is intended for use only by the
>individual or entity to which it is addressed, and may contain information
>that is privileged, confidential or exempt from disclosure under applicable
>law. If this is a forwarded message, the content of this E-MAIL may not have
>been sent with the authority of the Company. If you are not the intended
>recipient, an agent of the intended recipient or a person responsible for
>delivering the information to the named recipient, you are notified that any
>use, distribution, transmission, printing, copying or dissemination of this
>information in any way or in any manner is strictly prohibited. If you have
>received this communication in error, please delete this mail & notify us
>immediately at Mailadmin_at_mascotsystems.com Before opening attachments,
>please scan for viruses.
>
>
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: Suman S K
> INET: SumanK_at_mascotsystems.com

Justin Cave

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Justin Cave
  INET: jcave_at_cableone.net

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Sat Sep 14 2002 - 01:28:19 CDT

Original text of this message

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