cancel
Showing results for 
Search instead for 
Did you mean: 

Document Locking when updating keyword/keyword records.

Alan_LaQuay
Confirmed Champ
Confirmed Champ

In the Unity section of the SDK, the steps for modifying keywords indicates that the document lock should be applied prior to making the changes to the KWs and KW records, then releasing the lock after the "ApplyChange" is called.
I'm just curious if that is a requirement or best practice, or can the lock be placed immediately prior to the "ApplyChanges" call? Pros/Cons??

1 REPLY 1

Timothy_Cosgrif
Star Collaborator
Star Collaborator

The idea of placing the entire modify keyword logic within a document lock is similar to the idea of locking a document as soon as the document when an edit keyword panel is displayed in a client. The idea is that the document is locked both while the edits are made as well as when the edits are being persisted into the database. That way, a change cannot be persisted by another user while you are making your edits, which would be a possible data loss scenario.

It is also easier to scope out your modify keyword logic, which is why the DocumentLock type implements the IDisposable interface and can thus be used within a using statement (or try/finally if you are so inclined).

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.