• 如何处理Lotus的复制与保存冲突冲突文档的处理


    问题:运行在服务器上以及有多个复本的数据库难免会出现复制与保存冲突的情况。如何处理这种情况是所有Notes管理员和设计者都要面对的问题。

    复制与保存冲突可由以下原因造成:

    在两次复制之间,如果有两个用户同时编辑或多个用户编辑了不同数据库复本上的相同文档,就会出现复制冲突。如果有两个或多个用户同时编辑同一个数据库的同一个文档,则会出现保存冲突。

    解决方法:

    一、可以在表单属性框中的基本付签选中:“合并复制冲突”,并知底功能表单基本付签中的版本选项。

    二、在这里介绍一些和处理复制与保存冲突情况有关的方法与技巧:

    1、创建列出所有冲突文档的视图:(VewConflict)冲突文档都包含一个名为“$Conflict”的域,因此可以用下面的试图选择公式列出所有冲突文档。

    1 SELECT @ISAvailable("$Conflict")

    2、将冲突文档与主文档同屏显示以便比较两者之间的差别:由于冲突文档被保存为主文档的答复文档,在打开冲突文档以后使用快捷图标“显示/隐藏预览主文档”,主文档就会被显示在预览窗格中了。

    3、附加菜单命令比较两个文档之间的差别:在Notes.ini文件中加入下面一行:

    AddInMenus=C:\Notes\nntediff.dll

    然后重起Notes,就回发现“操作”菜单中多了一项“Different of 2 document”.  

    4、找到冲突文档的主文档:

    Sub Click(Source as Button)

    Const FolderName="ReplicationConFlict"

    dim s As New NotesSession

    dim doccol as NotesDocumentCollection

    dim doc as Notesdocument,topdoc as notesdocument

    dim folder as notesView

    set dbcur=s.currentdatabase

    set doccol.dbcur.unprocesseddocuments

    set doc=doccol.getfirstdocument

    while not(doc is nothing)

    set topdoc=gettopdoc(doc)

    call topdoc.putinfolder(Foldername)

    set doc=doccol.getnextdocument(doc)

    wend

    End Sub

    Function GetTopDoc(DocSource as notesDocument) as NotesDocument

    dim doctop as notesdocument dim strUNID as String

    set doctop=docsource

    strUNID=doctop.ParentDocumentUNID  

    Do While (strUNID<>"")

    set DocTop=dbCur.GetDocumentByUNID(StrUNID)

    strUNID=doctop.ParentdocumentUNID

    loop

    set GetTopDoc=doctop

    End Functiong  

      

    5、将冲突文档保存为主文档选种若干冲突文档后运行下面代理。这个代理把选种的冲突文档保存为主文档。

    dim s as new notessession

    set db=s.currentdatabase

    set dc=db.unprocessedDocuments

    set doc=dc.getfirstdocument '$conflict是冲突文档的标志

    call doc.removeItem("$Conflict") '得到冲突文档的主文档

    if doc.isResponse then

    Set Parent=db.GetDocumentByUNID(doc.ParentDocumentUNID)

    if parent.IsResponse then '如果文档是答复的答复

    dim GrandParant as Notesdocument

    Set GrandParant=db.GetDocumentByUNID(Parent.ParentDocumentUNID)

    call doc.MakeResponse(GrandParent) else '$Ref 域是答复文档的标志

    call doc.RemoveItem("$Ref")

    end if

    end if

    call doc.save(True,True)  

    当使用LS在后台创建文档的时候,表单中“合并复制冲突”选项无效,在文档中加入下面代码: doc.$Conflicts="1"  

  • 相关阅读:
    mybatis的知识点总结
    orm框架与缓存的关系
    mybatis知识点
    mybatis
    MyBatis的动态SQL详解
    工资谈判技巧
    MySQL 创建函数(Function)
    开始AFNetworking
    hdu 4778 Rabbit Kingdom(减少国家)
    设计模式:代理模式
  • 原文地址:https://www.cnblogs.com/hannover/p/2303882.html
Copyright © 2020-2023  润新知