8.9 Summary

Locks are the mechanism WebDAV provides to solve the lost update problem. A lock on a resource reserves it so that it can only be changed by the lock creator, and even then only when the client software provides the correct lock token.

LOCK is used to create and refresh locks, and UNLOCK is used to remove locks. Locks can be created on individual resources or on collections. Locks can be created on collections such that the lock covers all the collections internal resources or none of them (protecting only the collection's metadata).

Locks may have a limited lifetime. A WebDAV server may limit lock lifetime so that when a lock is accidentally left around, it eventually expires and gets cleaned up. Locks can also disappear once in a while before timeout, if administrators or resource owners have permission to remove unwanted locks.

The If header is used to provide the lock token when locked resources are updated. The If header is complicated, but a little care should allow clients to use it successfully. Clients should also use If-Match and If-None-Match headers to fully protect resources from lost updates.

Lock-null resources are special resources, created by LOCK, which reserve a URL so that it can be turned into a collection (MKCOL) or ordinary resource (PUT). Although many servers do not fully support lock-null resources, a client should be able to reserve a URL with LOCK and then use PUT.



WebDAV. Next Generation Collaborative Web Authoring
WebDAV. Next Generation Collaborative Web Authoring
ISBN: 130652083
EAN: N/A
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net