Objects in this class cannot be updated outside

问题

    外地出差的同事小周反映图形系统编辑时报"Objects in this class cannot be updated outside an edit session"错误,这个问题我网上搜了下被我找出原因来了,呵呵!属于程序的问题。

    当一个要素类参与了一个拓扑(或Geometry  Network)之后,对该要素类执行创建要素、修改要素图形或属性时,可能会出现这个异常:'Objects in this class cannot be updated outside an edit session'

原因
    这是由于ArcEngine应用程序中使用的 License权限不足引起的。在ArcEngine 应用程序里面通过ArcSDE进行编辑需要License'ArcGIS Engine Enterprise Geodatabase',或ArcEditor或ArcInfo。

 解决办法
    在ArcEngine应用程序的LicenseInitializer.InitializeApplication中,为程序增加Geodatabase的编辑权限。


    
Public Function InitializeApplication As Boolean

       '……
       licenseStatus = CheckOutLicensesesriLicenseProductCode.esriLicenseProductCodeEngineGeoDB

        licenseStatus = CheckOutLicensesesriLicenseProductCode.esriLicenseProductCodeEngine
       
       '……
    End Function

 由于同事在外地出差,程序没法修改,删除拓扑规则了事,不过这个bug还是要提交的。

用ArcGIS Engine对存储于ArcSDE中的数据时行编辑时会出现错误,错误提示为:Objects in this class cannot be updated outside an edit session,出现该错误时可以从以下几个方面去找一下问题:
   1.检查ArcGIS Engine的License文件的授权是否设置了ArcGIS Engine Enterprise GEo...
   2.检查是否注册了版本
   3.检查是否在数据库有与该图层有关系的图层,如拓扑关系,相连的注记层等。这些图层会占用编辑图层,出现错误

   4.检查要素的空间索引是否缺失。
   以上仅供参考,希望会对大家有所帮助!

原文地址:https://www.cnblogs.com/curtful/p/2208867.html