« Debug LotusScript For | Main| Domino Versioning Discussion »

Documents Stay Locked

Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

All ND6 databases have the ability to enable document locking, which is supposed to help reduce conflicts and inform people who is working with the document. Here is what Lotus has to say about Document Locking:

If you have Author access or higher to a document, and document locking is enabled for the database, you can lock the document on any replica while you are working in it. Locking a document allows you to lock out others who have editing access so they cannot modify the document at the same time you are, even if they are working on a different replica. This prevents two or more people from making changes to the same document and then saving it at the same time causing replication and save conflicts, where Notes doesn't know which edits to save....

Note You must be using Lotus Notes 6 and Lotus Domino 6 to use the document locking feature. You must also have an administration server defined in the access control list (ACL). If you do not have an administration server defined in the ACL, you receive an error from Notes. For more information on naming an administration server,

This is all good until clustering or replication is added to the equation. Before adding anything to the equation let me explain the equation. Lotus locks documents using $Writers and $WritersDate to mark who locked the document and when. These fields will be added to the document when the document is put into edit mode. If the document is not on the adminstration server Notes will add the locking fields and replicate the document the administration server. If the document is on the administration server the locking fields are added to the document, but the document is not replicated. Apparently adding the locking fields does not the mark as changed.

There are a varity of ways that the locking fields can stay around. Here is just one. The document is edit, changed and saved but the document is still in edit mode on the administration server. At this point Domino sees this as a change and replicates the changes throughout the cluster including the locking fields. If the document is then closed later without saving any changes then the locking fields would be removed from the adminstration server. Since the adding and removing of the locking fields are not seen as document changes the document will not be replicated, hence the locking fields on other servers.

Durring the day I use Toolbar Functions to removed the locking fields.
At night I use the following code:
SELECT @IsAvailable( $Writers ) | @IsAvailable( $WritersDate );
FIELD $Writers := @DeleteField;
FIELD $WritersDate := @DeleteField;

Comments

1 - Bill, I don't have access to Advisor. With your description I would have some concerns because of the stubs that would be left behind. If there is only one document to avoid the locking issue then I would have some concerns with replication conflicts with many people trying to update the same document. Pre 6 that would be the only solution, but if you are using 6.x or greater then I would recommend using the built-in features.

2 - Hi Chad,

In case you're ever in need of an alternative document locking solution, Devin Olson put together an outstanding system. His version doesn't modify documents to create locks, rather it creates a "lock document" for any document that is being edited.

If you have a subscription to Lotus Advisor, you can get the article and the code here:

http://my.advisor.com/doc/14568

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)