Re: Opinions on approach, please...
- From: "Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 27 May 2008 11:14:51 +1200
"William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx> wrote in message
news:ogA_j.446105$i_6.153114@xxxxxxxxxxxxxxxxxxxxxxxxx
<all previous parts of the thread are snipped>
Pete,
I the reason that I mentioned "locks" is that I am familiar with
applications that INTENTIONALLY used "locks" (of one sort or another) to
serialize specific steps. They didn't use them to "protect" from data
corruption. Rather they would use a "control" record to be "locked" when
one user/part-of-the-application/whatever was doing something to insure
that other parts/users didn't "start" a new process.
Yes, I have also encountered such systems. (In particular, when 3790s were
first introduced, back in the late '70s. This was a common practice, that
added layers of confusion to the online processing, was clunky and didn't
always work as expected.)
I'm sure you are right and there are still systems around that lock a
control record while a process completes. I wouldn't want to do it, and I am
certain that my client in this case doesn't use it, but such an effect could
be easily obtained by setting a semaphore on a certain DB row. It doesn't
need to be locked. If the flag is set, nobody kicks of a new process. The
owning process clears the flag when it completes. If it doesn't complete
then the process is locked out and threads trying to use it should complain
after a suitable timeout. (like I said, clunky... :-))
Micro Focus and the '02 Standard have "wait" syntax (within READ
processing - and as a separate statement). I couldn't find this in my
Fujitsu dox, so this may not be a problem there. (They do have file
status codes for accessing locked records).
As I say, this is not a question of 'accidentally" having two processing
attempting to update the same record; rather it is the use of specific
records (or files) to serialize processing.
***
I also wanted to explain (a bit) about the "multiple positioning" point
that I tried to make earlier. I don't know if this is used with non-IBM
mainframe COBOLs - or even if it is still used (much) on IBM mainframes.
The techniques was where you had two (or more) File-Control entries -
pointing to the same physical (VSAM) file - one via its "primary" key and
one via an alternate key (or possibly both via separate alternate keys).
Using START and READ NEXT processing, you could then process
"simultaneously" through the same physical file in two different
sequences. I could be mistaken, but I don't think that SQL can (easily)
do this via two "simultaneous" cursors for the same database. However, if
this isn't something that you have run into, then it may well be a
non-issue with the types of applications that you would want to convert.
I remember doing this on an ICL 1900, and later, on an IBM 360, not long
after disk drives became commercially available (early '70s, I think).. We
did a similar "trick" to obtain a sequential processing "lookahead" on a
given dataset. It was all pretty smart at the time; in retrospect it makes
me shudder... and smile :-) (How time flies... :-)).
Yes, it won't be a problem as RDBMS can easily maintain multiple cursors.
The data for the cursor is fetched into an internal result set at the time
you OPEN it, and the cursor is really just a pointer that steps up or down
the result set as required. Point being that rows are not actually fetched
when you issue a FETCH against a cursor, so different sequences of
processing have no impact on each other.
Thanks for your post, Bill.
Pete.
--
"I used to write COBOL...now I can do anything."
.
- References:
- Opinions on approach, please...
- From: Pete Dashwood
- Re: Opinions on approach, please...
- From: Robert
- Re: Opinions on approach, please...
- From: Pete Dashwood
- Re: Opinions on approach, please...
- From: Robert
- Re: Opinions on approach, please...
- From: Pete Dashwood
- Re: Opinions on approach, please...
- From: William M. Klein
- Opinions on approach, please...
- Prev by Date: Re: Opinions on approach, please...
- Next by Date: Re: Opinions on approach, please...
- Previous by thread: Re: Opinions on approach, please...
- Next by thread: Re: Opinions on approach, please...
- Index(es):
Relevant Pages
|