HP3000-L Archives

May 1998, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Denys Beauchemin <[log in to unmask]>
Reply To:
Date:
Thu, 7 May 1998 15:01:16 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (93 lines)
X-no-Archive:yes
There are three (3) valid values for the mode parameter of the DBCLOSE
call.

Mode 1, close the database, if you are the only one accessing the DB at
that time, it also purges the DBG, along with all the buffers in use by
IMAGE for that database.  If you are not the only one using the database
when you close it, DBCLOSE mode 1 purges the buffers reserved for your
process, releases all the locks your process may have in the DB, and
decrements the users counter by one.

You use mode 1, when your process (program) has finished accessing the
database, usually at the end of the program.  It's a nice clean way of
programming.  Your program doesn't really have to use DBCLOSE, because  MPE
will close it for you when your program ends, but you should use DBCLOSE,
mode 1.

Mode 2 reinitializes dynamic status information for the dataset, for your
process, and closes the data set for access, again for your process.  The
locks your process may have in that dataset are not released.  Note that if
other users are using that dataset, they are unaffected, (except for the
locks.)  You use mode 2 to close a dataset that you know will not be used
by your process again.

Mode 3 does the same thing as mode 2, but leaves the dataset open for your
process.  This is used to place your pointer at the beginning of the
dataset.  In other words, the next DBGET mode 2 that you issue after a
DBCLOSE mode 3, will read the first entry in the dataset.  You would use
this to ensure your process is at the beginning of the dataset if you have
accessed data earlier in the process, since the initial DBOPEN.

DBCLOSE modes 1,2 and 3 only deal with a process' access of a database
(mode 1) or a dataset within a database (modes 2 &3).  It does not impact
other processes accessing that database/dataset, except when they release
held locks.

As such, I fail to understand the reasoning behind the call to DBCLOSE to
"rewind" a dataset being used for the first time by a newly-started
program. When the program starts and accesses the dataset for the first
time, the first record will be received by the first call to DBGET.  A
DBCLOSE issued by one process would have no bearing on another process.  So
why does the original poster use such a call in his program?

As far as the serial reads are concerned, it is my understanding that IMAGE
uses mapped I/O, and as such does not really read serially, as much as
position the "cursor" at each record in turn.  There are several reasons a
serial read might miss records, if the dataset is not locked during the
entire read.  Migrating secondaries, new entries added etc.
Kind regards,

Denys. . .

Denys Beauchemin
HICOMP America, Inc.
(800) 323-8863  (281) 288-7438         Fax: (281) 355-6879
denys at hicomp.com                             www.hicomp.com


-----Original Message-----
From:   Costas Anastassiades [SMTP:[log in to unmask]]
Sent:   Thursday, May 07, 1998 4:30 AM
To:     [log in to unmask]
Subject:        Re: rewind datasets...part 2.

I'm sure others might offer a more "scientific" explanation, but in short
it means move the record pointer to the 1st record in order to perform
(usually) a serial read of all records.

By the way, I seem to remember reading somewhere that a serial read of a
master dataset is in fact a "simulated" serial read. IOW, a pointer
positioning algorithm kicks in, which then gets each entry as "if" they
where being read serially. I have a vague recollection that the document?
advised against serially reading a master as there was a possibility of not
actually reading all entries ...
I'm not that old, yet memory "is" starting to fail ...

Costas Anastassiades,
Athens-Greece

----------
From:   John W Pickering[SMTP:[log in to unmask]]
Sent:   ?Yi?oc, 7 IaAio 1998 1:32 ?i
To:     [log in to unmask]
Subject:        FW: rewind datasets...part 2.

>NEVER MIND! --- I found out what was wrong. It was my bent code. :-) Ron
in
>California knows about bent code. Sorry for the msg....

Just out of curiosity, what does "rewind a dataset" mean anyway ??

JWP

ATOM RSS1 RSS2