首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >更新序列号不匹配;请求的USN = 2,数据库USN =3

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

Stack Overflow用户
提问于 2016-02-03 19:34:39
回答 1查看 974关注 0票数 0
代码语言:javascript
复制
        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);
            }

但是,toFolder.save(RefreshMode.REFRESH);未正确执行,并且即将出现异常

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

在这里,对象指的是创建的新文件夹。

EN

回答 1

Stack Overflow用户

发布于 2016-02-04 07:05:47

从IBM文档判断,我认为您应该先创建文件夹,然后再考虑归档问题。

代码语言:javascript
复制
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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35175933

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档