On this page I try to collect everything on Resource Locking.
One of the core concepts of Horde is the ability to collaboratively create and share information. However there is no technical means to prevent users from stepping on each other when modifying shared resources (such as Wiki pages, tasklist or calendar items etc.). The goal of the Horde_Lock project is to create a library that allows an application to request and manage locks on resources it manages.
The original driver for this library is the evolving WebDAV support in various Horde applications. Horde can not claim WebDAV class 2 compliance without a mechanism for managing and respecting locks. It quickly became clear that these locks could be used outside WebDAV to good effect on all shared Horde resources.
There are (at least) two ways to prevent conflicts when editing shared resources:
Locking The easy one is to lock an item for a certain time when someone starts to edit it. If someone else trys to edit it Horde will deny this and tell the user to wait. The disadvantage of this is that only one person can edit one item at one time which on a popular system may be cumbersome. However there is additionally the concept of a "shared" lock which may be useful with the next strategy.
Try to merge An improved approach would be to allow Horde applications to try to merge the changes two users make similar to source control software. If changes cannot be merged automatically Horde will notify the user. Horde_Lock will make no attempt to implement merging as this is highly application specific but is designed to allow applications to use the shared lock concept in concert with a merging strategy.
Since a mechanism is needed to lock resources for full WebDAV functionality a new Horde_Lock subsystem has been merged into Horde 3.2. This subsystem is capable of locking arbitrary resources identified by URI and grouped by scope. The locks support timeouts and exclusive vs. shared semantics.
The API has been published in the Horde API documentation. Anyone interested in this project is invited to review the following URL and provide feedback to the Horde Dev mailing list.
* Extend other Horde apps (Mnemo, Nag, ???) to use Horde_LockThese are potential uses for the Lock system that have been requested or proposed by others.
Ben Klang <firstname.lastname@example.org>