6.0.0-git
2018-12-13
Last Modified 2008-08-10 by Ben Klang

On this page I try to collect everything on Resource Locking.

The idea

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.

Conflict Resolution Strategies

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.

Project Status - August 2008

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

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.
http://dev.horde.org/api/framework/Horde_Lock/Horde_Lock.html

Completed Tasks

  • The SQL driver is complete and integrated and was released with Horde 3.2
  • All semantics necessary to support WebDAV locks are complete. A partial implementation has been released with Horde_RPC_webdav class that was released with Horde 3.2.

TODO

  • Implement administrator's UI that lists all active locks with the ability to delete stale and/or arbitrary locks.
  • Extend Wicked to take advantage of Horde_Lock (caution: Maintain backward compatibility)

Wishlist

These are potential uses for the Lock system that have been requested or proposed by others.
* Extend other Horde apps (Mnemo, Nag, ???) to use Horde_Lock

Contact

Ben Klang <ben@alkaloid.net>