T.R | Title | User | Personal Name | Date | Lines |
---|
2061.2 | | KERNEL::LOAT | Ahead groove factor 5! Yeah! | Mon Jan 11 1993 17:05 | 11 |
|
No luck I'm afraid.
Suzannes idea would only give you information about the 'reserved'
status of a document, not whether it had been locked or not by the CAB
LOCK function.
Any ideas anyone?
Steve.
|
2061.3 | | IOSG::MAURICE | Because of the architect the building fell down | Tue Jan 12 1993 08:17 | 24 |
| Hi,
Using reservations instead of locks has the advantages:
a) You can reserve many documents at the same time whereas you can
only lock one document.
b) You can find out who reserved a document.
c) The CAB LOCK function is limited to local drawers.
The only way to determine from the API what the current lock state is,
is to try to lock the document yourself.
IF READ fails
THEN someone else has an EXCLUSIVE lock.
ELSE IF WRITE fails
THEN someone else has a WRITE lock
ELSE IF EXCLUSIVE fails
THEN someone else has a READ lock.
Cheers
Stuart
|
2061.4 | Examples? | KERNEL::LOAT | Ahead groove factor 5! Yeah! | Fri Jan 15 1993 10:37 | 11 |
|
I've tried using CAB LOCK, and checking if a document is locked, but no
luck. I've tried using OA$STATUS, but this always returns a value of 1.
Has anyone got an example of a script or named data which shows this
checking in action?
Thanx
Steve.
|
2061.5 | WP_SYS_EDIT.SCP | IOSG::MAURICE | Because of the architect the building fell down | Fri Jan 15 1993 13:11 | 8 |
| Hi,
There is an example of use in the version of WP_SYS_EDIT.SCP that is in
V3.0-1.
Cheers
Stuart
|
2061.6 | | KERNEL::LOAT | Ahead groove factor 5! Yeah! | Fri Jan 22 1993 11:24 | 13 |
|
I've tried to get this working correctly, but no luck. Whatever I do, I
get OA$STATUS returning 1. If I use CAB LOCK on a document twice in a
row, does the second lock 'undo' the first one? If I do thisa twice ina
row, I get OA$STATUS returning 1 twice, even though the second CAB LOCK
should have failed.
Examples? Ideas?
Thanx
Steve.
|
2061.7 | Make it fail | IOSG::MAURICE | Because of the architect the building fell down | Mon Jan 25 1993 09:08 | 17 |
| Hi,
To get it to fail have USERA select a document. Return to the MAIN menu
where there is no form pre-processing to get in the way. Repeat this
same procedure on the same document for USERB. Then have USERA type
< cab lock "exclusive"
Now have USERB try and do the same.
What you are seeing is that the CAB LOCK function is controlling
simultaneous access to the document by two different users (two
different processes to be strictly accurate).
Cheers
Stuart
|
2061.8 | | KERNEL::LOAT | Ahead groove factor 5! Yeah! | Mon Jan 25 1993 15:49 | 18 |
|
That has cleared something up, that CAB LOCK only works across users,
and you cannot lock a document from yourself.
I tried this for two users, and when the second one tried this, they
got an error
"Document currently being accessed by another user."
but the value of OA$STATUS is still 1. Should CAB LOCK update
OA$STATUS, or is somtthing else going on? I suggested using
OA$MSG_PURGE, and then trying the CAB LOCK, followed by looking at the
contents of OA$MSG_TEXT, but this seems a bit of a kludgy 'workaround'
Thanx
Steve.
|
2061.9 | Form in the way? | IOSG::MAURICE | Because of the architect the building fell down | Mon Jan 25 1993 18:40 | 9 |
| Hi,
When you tried this were you by chance testing it with a form current
(like the WP form) which will change OA$STATUS as part of the Named
Data pre-processing?
Cheers
Stuart
|