Re: Succesful Status code (was: Request for testing of Reltive File status
- From: riplin@xxxxxxxxxxxx
- Date: Tue, 19 May 2009 12:09:08 -0700 (PDT)
On May 20, 2:30 am, docdw...@xxxxxxxxx () wrote:
In article <067d11f8-5e26-40c5-9383-d5272a8f4...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
I would not have the code that you have written above in my system and
would consider it to be wrong.
Were you to consider it to be incorrect, Mr Plinston, you appear would be
at odds with the manual.
I did not say that the statements or file status were 'incorrect' at
all.
What would be wrong, if that code were in _my_ system (please note the
qualification this time), is that after detecting that a record exists
with a WRITE statement you overwrite that record.
For creating a new record I always READ
the primary key first so that I know whether it is an update (REWRITE)
or an insert (WRITE). If the WRITE then fails on a '22' it is because
some other user has intervened and created the record between my READ
(which was unsuccessful) and the WRITE. Overwriting with the REWRITE
would then be wrong.
When creating a new record on a multi-user system I build the record in
WORKING-STORAGE and then wait for the operator to press the key which
signals a WRITE is to be performed. I then READ based on the key and make
decisions based on the kind of system, transaction flow and how the users
have specified they want updates of existing records handled... you know,
do what *they* want, not what I Know Is Best For Them.
That may be so in your systems, but not in mine. If a READ had
previously determined whether the record existed then it would be
known whether a WRITE or a REWRITE is required. If either of those
gives an unsucessful file status then there is a problem that needs to
be dealt with, and not by simply overwriting existing data.
I am surprised that you think that overwriting some record is
acceptable, it would destroy data.
I am surprised that your experience seems not to have included updating
widgets-on-hand or seats-available-on-a-flight data, which change
constantly and, thus, are subject to constant destruction-and-re-creation..
I am not sure how you determined what you think is my experience.
I gave an example of how a wrongness may occur, you appear to have
dismissed that situation. Perhaps your experience of multi-user shared
file systems is rather less than mine.
Different situations, Mr Plinston, require different solutions... what
happens, at the machine level, when one encounters a DUPEKEY does (or,
more precisely, should) not.
Which is why my comments were qualified to be my systems. If you had
noticed that then you may have been less tedious in your response.
.
- References:
- Re: Succesful Status code (was: Request for testing of Reltive File status
- From: riplin
- Re: Succesful Status code (was: Request for testing of Reltive File status
- From: riplin
- Re: Succesful Status code (was: Request for testing of Reltive File status
- From:
- Re: Succesful Status code (was: Request for testing of Reltive File status
- From: riplin
- Re: Succesful Status code (was: Request for testing of Reltive File status
- From:
- Re: Succesful Status code (was: Request for testing of Reltive File status
- Prev by Date: Re: No wonder we can't get jobs...
- Next by Date: Re: Succesful Status code (was: Request for testing of Reltive File status
- Previous by thread: Re: Succesful Status code (was: Request for testing of Reltive File status
- Next by thread: Re: Succesful Status code (was: Request for testing of Reltive File status
- Index(es):
Relevant Pages
|