[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

2061.0. "Is this document locked?" by KERNEL::LOAT (Ahead groove factor 5! Yeah!) Mon Jan 11 1993 14:34

     
    A customer is using the CAB LOCK function to lock documents, and he's
    trying to find a way to check for a document being locked. He couldn't
    find out how, so he asked us!
    
    Now, we can't find out how to do this, so I thought I'd ask you lot!
    
    Any ideas?
    
    Steve.
    
T.RTitleUserPersonal
Name
DateLines
2061.2KERNEL::LOATAhead groove factor 5! Yeah!Mon Jan 11 1993 17:0511
    
    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.3IOSG::MAURICEBecause of the architect the building fell downTue Jan 12 1993 08:1724
    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.4Examples?KERNEL::LOATAhead groove factor 5! Yeah!Fri Jan 15 1993 10:3711
    
    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.5WP_SYS_EDIT.SCPIOSG::MAURICEBecause of the architect the building fell downFri Jan 15 1993 13:118
    Hi,
    
    There is an example of use in the version of WP_SYS_EDIT.SCP that is in
    V3.0-1.
    
    Cheers
    
    Stuart
2061.6KERNEL::LOATAhead groove factor 5! Yeah!Fri Jan 22 1993 11:2413
    
    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.7Make it failIOSG::MAURICEBecause of the architect the building fell downMon Jan 25 1993 09:0817
    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.8KERNEL::LOATAhead groove factor 5! Yeah!Mon Jan 25 1993 15:4918
    
    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.9Form in the way?IOSG::MAURICEBecause of the architect the building fell downMon Jan 25 1993 18:409
    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