IBM®
Skip to main content
    Country/region select      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

When a document is created, it's assigned a unique ID based on the creation time. However, the clock ticks over about every .01s, so if you create two documents in a very short time, it gives the second one a future creation time. Normally you don't notice this because this time is just .01s ahead, but if you create many, many documents in a short time, each has to have a unique creation time, so it pushes the time farther and farther forward, until it can be off by hours -- enough that users who create documents in the morning may find they're shown as being created early that afternoon, for instance.

If you modify an existing document, you aren't assigning a new ID, so I believe Notes doesn't find it necessary to advance the clock to prevent two documents having the same modified time. But if you create a document, and then modify a document (even if they aren't the same document), we want the creation time and the modified time to be in the right order. So if the creation time has been pushed ahead, this will also affect the modified time of documents you edit.

Mass document creation most often happens because of an agent that deletes all the documents overnight, and creates all new ones from some outside data source. Another effect of such an agent is to create many, many deletion stubs -- many times more than you have documents. There are many reasons you don't want to do this; weirding out your creation/modification times is one of the more minor ones. It's much better to synchronize documents with an outside data source by locating the corresponding old documents and only updating them if you need to.

The algorithm for doing such an update is shown in this download. It contains an agent named "5. Replicate Pirates," with a reusable replication engine that reads one record at a time from two LC LSX result sets and compares the keys and data values to decide whether or not there's a difference between the records, synchronizing the data one-way. This is possibly slower than just deleting and re-creating, but possibly not, since those deletion stubs tend to hurt performance.

Andre Guirard | 24 June 2008 11:16:38 AM ET | Home, Plymouth, MN, USA | Comments (7)

Search this blog 

Disclaimer 

    About IBM Privacy Contact