Locking in PH
Chris Sharman
Chris.Sharman@ccagroup.co.uk
Tue, 19 Dec 2000 09:38:20 +0000
>I store my next invoice number in a one-record direct file which will be
>updated as the user create new invoice.(seq. no. generation.)But I find out
>that the file was never locked when dup-record error was reported from user.
>
>I never expect simple function like seq.-no.-generation will go wrong, is it
>the problem of choosing file type (Direct organ.)?
The file's fine, I believe (similar to what we use).
I believe it's a flaw in the Powerhouse locking scheme (or rather in the way it
employs the VMS lock management system).
Powerhouse file locking DOES NOT WORK on VMS/RMS across different UIC groups
(bug 290638): as far as I know it has been broken a long time, perhaps forever.
Powerhouse record locks are RMS record locks (if you're using RMS): tried &
tested around the world since 1977 & working well.
Powerhouse file locks, on the other hand, are specific to Powerhouse. They use
the VMS locking system. If you wish to make a 3gl application use Powerhouse
file locks, you have to use DALOCK.OBJ.
PH file locking uses locks named (count)'Device:xxxxyyyyzzzz' in UIC group
locking domains (read up on the $enq system service to better understand
locking). This has the unfortunate effect that two or more users in different
UIC groups can hold the same 'exclusive' lock at the same time independently.
In other words, there's no locking at all, unless all your users are in the
same UIC group (eg [100,*]).
To get locking which works, use "lock invoice_cnt record", and forget all about
DALOCK in your 3gl applications. If you _really_ need file locking, use 'open
file exclusive' or similar, or confine all your users to one UIC group.
The above has been the subject of various support calls from me, and has been
given bug number 290638. It's unlikely to get fixed, since it's insufficiently
reported (I was apparently first, early this year, despite it having been
around for a long time). This may be because TSC's practice was to recommend
'lock record' when you reported problems with 'lock file', which would of
course workaround the problem. The only problem is that you can't easily write
a QTP run to use a refnum file (like invoice_cnt) in a way that locks correctly
with Quick.
Regards,
Chris
_______________________________________________________________________
Chris.Sharman@CCAgroup.co.uk http://www.ccagroup.co.uk/
CCA Stationery Ltd, Eastway, Fulwood, Preston, Lancashire, PR2 9WS.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.