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

Theo Heselmans complains about profile documents that get overwritten when users create local replicas. He describes the process by which this occurs:

- Replicate a db with a dbprofile doc
- Interrupt the replication, so the db is not yet fully initialized (some users do this)
- Open the replica: the db postopen script sees there is no dbprofile yet, and creates a blank one.
- if the user then continues with the replication, the 'main' dbprofile is overwritten, loosing all data.
I ended up with creating a backup and restore procedure for the profile docs.

This is actually something I described in one of my comments. The profile document does not get overwritten. The above set of steps results in the creation of a new profile document in the local replica, which then replicates to the server. Rather than backup and restore, the solution is to delete the new, blank profile, so that the old one is found again when someone tries to read a profile field.

Better yet, prevent the problem from occurring in the first place. Before the user has a chance to try to reference the missing profile, check that it exists and if it doesn't, kick them out. This code in the database script should do the trick:

Sub Postopen(Source As Notesuidatabase)
   Dim db As NotesDatabase
   Set db = Source.Database
   Dim collProfiles As NotesDocumentCollection
   Set collProfiles = db.GetProfileDocCollection("MasterProfile")
   If collProfiles.Count = 0 Then
      Msgbox "Please finish replicating this database before you open it. The profile document is missing.", 16, "Oops!"
   End If
End Sub

Andre Guirard | 16 August 2007 01:00:00 PM ET | Café Porch, Plymouth, MN, USA | Comments (1)

Search this blog 


    About IBM Privacy Contact