> 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 ?

Enforcing that the client submits the token for any operation (that's a
requirement of the WebDAV spec). Since I thought it was a nice feature, I
decided to add it in the core.

An application can switch that off (that's condition2), but the WebDAV
servlet definitely has to enforce that.

condition3 will (should) be true if the client submitted the appropriate
token(s).

> 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.

It does work very well with Office 2k (with a recent IE). The lock is
refreshed every 2 minutes, and successfully unlocked when you're done. DAV E
also works great (I use it to monitor the lock status).
Older combos of Office / IE had problems with locks.

Remy

Reply via email to