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

Home -> Community -> Usenet -> c.d.o.misc -> Re: lock Oracle db objects, but only a lock for others?

Re: lock Oracle db objects, but only a lock for others?

From: Simeon Rice <tampa_at_bucs.com>
Date: Sun, 20 Apr 2003 19:35:12 GMT
Message-ID: <PDCoa.390994$jy1.57420@post-02.news.easynews.com>


You're basically asking for someone to teach you Oracle's Concurrency Model. You'd do better to explain to management that your staff lacks that expertise and bringing in an outside expert would help imrpove your application development.

"Bob Kilmer" <rprgrmr_at_yahoo.com> wrote in news:38Coa.57548$D15.1636488_at_twister.tampabay.rr.com:

> Dan,
> Are you trying to say I am asking too much of this newsgroup?
>
> Bob
> "Daniel Morgan" <damorgan_at_exesolutions.com> wrote in message
> news:3EA2E831.F3D5B301_at_exesolutions.com...

>> Bob Kilmer wrote:
>>
>> > >expect that the entire code base needs to be rewritten
>> >
>> > I agree but this is not practicable. Not only that, without
>> > learning something, we are likely to write something only a little
>> > better or 

> merely
>> > with different foibles. As it is, I hope to make an admittedly bad

> situation
>> > less bad. Can any one address my questions directly? Some of the
>> > are 

> yes-no
>> > questions. Surely someone can manage that.
>> >
>> > Bob
>> >
>> > "Daniel Morgan" <damorgan_at_exesolutions.com> wrote in message
>> > news:3EA2DF84.6075EA5_at_exesolutions.com...
>> > > Bob Kilmer wrote:
>> > >
>> > > > Jim,
>> > > > Thanks for your response. I am new to the app and the company.
>> > > > I 

> didn't
>> > > > invent the locking and unlocking chaos, I am trying to cure it.
>> > > > I do 
>> > read
>> > > > the docs online and I will look at what you suggest, but it
>> > > > takes a 
>> > while
>> > > > for it all to sink in and to find just the right answer and not
>> > > > just 

> a
>> > > > generic lesson in locking database objects.
>> > > >
>> > > > Now that I've finished being defensive, let me say the locking
>> > > > that 

> the
>> > code
>> > > > uses is a 'select for update', sometimes with and without a
>> > > > nowait, 
>> > between
>> > > > a begin trans and commit or rollback. But the code places a
>> > > > lock 

> that
>> > gets
>> > > > in its own way! So it commits (or rollsback - who knows - On
>> > > > Error 
>> > Goto!) to
>> > > > release the lock when it passes control to whatever code it
>> > > > thinks 

> might
>> > > > need access to the data that it would prefer to remain locked.
>> > > > And 

> that
>> > code
>> > > > sets a lock again. (Or should. Or maybe not?) And this happens
>> > > > again 

> and
>> > > > again as the client opens and closes form after form getting or

> posting
>> > > > data, locking and unlocking data, starting and ending
>> > > > transactions, 
>> > before
>> > > > the finally the process is through.
>> > > >
>> > > > Besides all that, the app doesn't really lock all the data up
>> > > > for 

> grabs.
>> > The
>> > > > app really just locks a mutually agreed upon row in a
>> > > > particular 

> table.
>> > This
>> > > > lock then serves as a flag to other instances of the app not to
>> > > > fool 
>> > with
>> > > > the data. Not that one couldn't fool with the other data that
>> > > > is not 
>> > locked.
>> > > > So if all the clients are using this as a flag, they may as
>> > > > well use 

> an
>> > > > explicit flag, i.e., a flag table value, unless the app can set
>> > > > a 
>> > reasonable
>> > > > lock that won't get in its own way, don't you think?. Intuition

> tells me
>> > > > that this lock, unlock, lock unlock madness is bogus,
>> > > > especially 

> when it
>> > > > encumbers the code so, and isn't really locking all the data
>> > > > that is exposed.
>> > > >
>> > > > Should the client be using db locking at all?
>> > > >
>> > > > Can the client set a legitimate lock that won't get in its own
>> > > > way? 
>> > > >
>> > > > Would it be just as well to set a flag in a table of flags?
>> > > > (That 

> is, in
>> > > > effect, what is being done now - except it is a table of real
>> > > > data!) 
>> > > >
>> > > > Is there another option that is cleaner, easier and more

> professional
>> > that I
>> > > > have yet to discover?
>> > > >
>> > > > I would prefer to be able to set a lock or a flag exactly once
>> > > > at 

> the
>> > > > beginning of a client input or edit process, do the input or
>> > > > editing machinations, then unlock or lower the flag (once) when
>> > > > I am out of 
>> > there.
>> > > >
>> > > > Regards,
>> > > > Bob
>> > > >
>> > > > <snipped>
>> > > >
>> > >
>> > > I'm just guessing based on things in your post but what catches
>> > > my eye 

> are
>> > > things like:
>> > >
>> > > begin trans
>> > > On Error Goto
>> > >
>> > > If things like this have been written expect that the entire code
>> > > base 
>> > needs to
>> > > be rewritten.
>> > >
>> > > Daniel Morgan
>> > >
>> > >
>>
>> Then hire someone to train your staff.
>>
>> I can certainly suggest someone that can fly to where-ever you are
>> and do 

> so.
>>
>> You will learn more and save money with an on-site instructor for one
>> week 

> or
>> two weeks.
>>
>> If you are interested in pursuing this option one person I can
>> recommend 

> is Jack
>> Cline. You can email him at jcline_at_deltabravo.net.
>>
>> Daniel Morgan
>>
>>

>
>
>
Received on Sun Apr 20 2003 - 14:35:12 CDT

Original text of this message

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