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

For performance reasons, it's generally smart to set NotesView.AutoUpdate = False to prevent LotusScript from constantly "refreshing" the view internally whenever it notices there's a document change (which, if your agent is modifying every document in the view, can happen a lot). Even if you're saving documents that aren't in the specific view, it saves time if LotusScript doesn't have to continually check whether the recently modified document is in the view.

However, yesterday I found another reason to use this property, unrelated to performance. It seems that if you use a NotesViewNavigator, and the view you got it from does not have AutoUpdate=False, the NotesViewNavigator can fail to get the next document (with the message "Entry not found in index", referring to a NotesViewEntry object). I've only seen this happen if the entry is a category, but I'm not sure it's the only case where it happens. Even though I was only reading documents, someone else changed a document on the server, this caused the view to update, and the NotesViewEntry object became invalid.

This is a sneaky problem. It's not going to happen when you're testing the agent with nobody else using the application. Code defensively -- use view.AutoUpdate=False routinely.

Andre Guirard | 7 February 2008 08:41:07 AM ET | Man-cave, Plymouth, MN, USA | Comments (7)

Search this blog 


    About IBM Privacy Contact