更新序列号不匹配;请求USN = 2,数据库USN = 3

时间:2016-02-03 11:34:39

标签: filenet-content-engine

我正在使用Filenet 4.5.1我的项目中有一个模块,我们将内容从文件夹移动到新创建的文件夹,然后从旧文件夹中删除它们。

        ObjectStore objectStore;
        ReferentialContainmentRelationship toRcr = null;
        ReferentialContainmentRelationship fromRcr = null;
        DocumentSet documentSet;
        Iterator documentIterator;
        documentSet = fromFolder.get_ContainedDocuments();
        documentIterator = documentSet.iterator();
        Document document;
        while(documentIterator.hasNext())
            {   

             document = (Document) documentIterator.next();
             toRcr = toFolder.file(document,AutoUniqueName.AUTO_UNIQUE, document.getClassName(),DefineSecurityParentage.DO_NOT_DEFINE_SECURITY_PARENTAGE);

             toRcr.save(RefreshMode.REFRESH);
             toFolder.save(RefreshMode.REFRESH);
             fromRcr = fromFolder.unfile(document);
             fromFolder.save(RefreshMode.REFRESH);
            }

但是,这里是Folder.save(RefreshMode.REFRESH);没有正确执行,而且会有例外

FNServices.getOldFileFolderObject()中的异常:对象{ADF64C74-F80D-4BD7-8A58-86699C66BFAC}自检索以来已被修改。更新序列号不匹配;要求USN = 2,数据库USN = 3。

此处,对象是指创建的新文件夹。

1 个答案:

答案 0 :(得分:1)

从IBM文档判断,我认为您应该首先创建您的文件夹,然后担心之后的文件。

ObjectStore objectStore;
    ReferentialContainmentRelationship toRcr = null;
    ReferentialContainmentRelationship fromRcr = null;
    DocumentSet documentSet;
    Iterator documentIterator;
    documentSet = fromFolder.get_ContainedDocuments();
    documentIterator = documentSet.iterator();
    Document document;
    toFolder.save(RefreshMode.REFRESH);
    fromFolder.save(RefreshMode.REFRESH);
    while(documentIterator.hasNext())
        {   

         document = (Document) documentIterator.next();
         toRcr = toFolder.file(document,AutoUniqueName.AUTO_UNIQUE, document.getClassName(),DefineSecurityParentage.DO_NOT_DEFINE_SECURITY_PARENTAGE);

         toRcr.save(RefreshMode.REFRESH);

         fromRcr = fromFolder.unfile(document);
         fromRcr.save(RefreshMode.REFRESH);
        }

看看这里:Working with Containment