SDE数据提交编辑冲突:“The Version has been redefined to reference a new database state .[sde.default]”...

    一、问题

    多人同时用SDE用户编辑同一SDE数据库中得DEFAULT版本,在STOPEDITING提交编辑时报错:“The Version has been redefined to reference a new database state .[sde.default]”。

    二、分析

    引用官方的分析:

    The StopEditing method is used to end an edit session. The saveEdits parameter controls if edits are saved or discarded. A multi-versioned database can support multiple concurrent edit sessions on the same version of the database. In such a scenario, StopEditing will return an error code of FDO_E_VERSION_REDEFINED if it detects that the database state associated with the version being edited is no longer the same as it was at the beginning of the edit session (indicating that the version was modified by some other edit session). In this case the application is responsible for calling the IVersionEdit::Reconcile method to reconcile the edit session against the current state of the version being edited. StopEditing may be called again after reconciliation.

    三、解决方案

    在保存的时候加上一段代码:

    Dim pVersion As IVersion Set pVersion = g_pWorkSpace Dim pVerWorkspace As IVersionedWorkspace Set pVerWorkspace = g_pWorkSpace Dim pVersionEdit As IVersionEdit Set pVersionEdit = pVerWorkspace Dim Success As Boolean Success = pVersionEdit.Reconcile("SDE.DEFAULT")

    然后在保存一次,运行可以通过,不过好像还是会影响其他用户对该图层的编辑结果。

转载于:https://www.cnblogs.com/haiping/articles/2175515.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值