Problem solve Get help with specific problems with your technologies, process and projects.

Best method to implement record locking

I'm using Lotus Notes 4.6, and I've been developing Notes applications for 1 year. In the last month, I started a project where I needed to use some sort of record locking. In my research, I have found many ways to do this but never knew which was the best method to use.

I know that Lotus Notes 4.6 has no default functionality for this. So, I'm asking you ...what method you use personally and what do you think is the best method to implement record locking?

And if it's not to much to ask...is it possible to get coding or at least direct me to a Web page where I can find the information base upon the answers your provide it?

The method that works for me (and I'm sorry I don't have any code I can show you) is actually pretty simple: It's made up of just a couple of elements, and can be plugged into any application in minutes:

1. Create a database (well call RecordLock) which has a form with a field for the original document's UNID, Current Editor's Name, and Time Checked Out on it (or create a form in the current database with these fields).
2. Create a view in the RecordLock db which shows only those documents created with the above form, sort on the first column, and make that column the UNID field you created in the form.
3. Create a subform in your original database, and put in the following:

 In QueryOpen: If this is a new document, go ahead and open it (Continue = true) If this is an existing document, Open the RecordLock DB and View and check to see if this document's UNID is in the list If it is, throw up an error message and set Continue = False If it is not, set Continue = True and create a RecordLock document for this document in the RecordLock DB. In QueryModeChange: If we are entering Edit Mode, perform the same code as in QueryOpen, essentially. If we are exiting Edit Mode, we don't have to do anything. In QueryClose: Open the RecordLock DB and View and see if this document's UNID is still in the list If it is, remove it (delete the document)

I would also recommend having an agent that compares the time open values and runs every couple of hours and automatically releases any lock documents (by deleting them) overnight, or at some predetermined schedule. You can also set up a person who has the authority to release those locked documents manually, too.

The reason for this is, if someone is working in a document and then (1) goes to lunch, or (2) has Notes blow up on them, or (3) has windows blow up on them, etc. the documents wouldn't be locked forever.

Hope this helps!

Dig Deeper on Domino Resources - Part 2

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...