Hi,

Source code snippet from LockImpl.java:

   public void unlock(SlideToken slideToken, NodeLock token)
       throws ServiceAccessException, LockTokenNotFoundException {
...
           // Was a proper lock token given out ?
           boolean condition3 = checkLockToken(slideToken, token);
          
           if ((!condition1 && !condition2) || (!condition3 && 
condition2)) {
               return;
           }
       } catch (ObjectNotFoundException e) {
           return;
       }
       Uri lockedUri = namespace.getUri(slideToken, token.getObjectUri());
       lockedUri.getStore().removeLock(lockedUri, token);
   }

In my opinion condition3 will never evaluate true, hence the lock is not 
removed (suppose condition2 evaluates true).
A slideToken is created for every request and the UNLOCK request will 
not store locks into the slideToken.
Question is: what is the use of storing locks with the slideToken ?

The lock will of course expire later on, but consider the following:
Open a file in e.g. MS Word
Close the file (this performs an UNLOCK request)
Re-open the file (within the expiration timeout). The file will be 
opened as read-only because the file is considered locked.

Regards, Nelis


Reply via email to