So before anything I've been browsing this topics for a week now, with no solution in sight.
An error occurred while attempting to open an insertcursoron the table'XXXX'. The error numberfrom ArcObjects is: '-2147216556'. The error message from ArcObjects is: {Objects in this class cannot be updated outside an edit session [XXXX]}
A fatal error has occurred. Check the logfile above for details
What i've been trying:
Change Transaction type to: 1: Versioned Edist Session, 2:Non- versioned Edit Session, 3: Transactions, 4:None
Delete all attributes on a given feature to see if some was causing trouble
Override username, password with the sde user
Checking that there are no locks on the feature
Asserting correct FeatureClass or table Name
Asserting correct FeatureClass or table Qualifier
Asserting correct Feature Dataset
Asserting correct geometry type
Drop Table (yes and no)
Truncate table (yes and no)
Tried setting the attribute geodb_feature_dataset manually with correct values
And lastly toggle all advance options on the feature writer.
And for a last information the topology is enabled for the feature dataset I'm trying to write to.
I have also tried to recreate the sde connection file
I tried to create a new version in the ArcCatalog and create an sde connection file that points to the new version
Please anyone who can point me in the right direction to solve this will be highly appreciated :)
Best answer by paalped
Ok, so these are the steps need for writing to an SDE with topology enabled:
I don't know why there is no transformers for this operation, but its quite simple.
First I have located where my featureclass is beeing part of a topology
And this is the hardcoded python script:
import fme
import fmeobjects
import arcpy
from arcpy import env
topology = r"H:\my_sde_connections\my.sde\my_feature_dataset\my_topology"
featureclass = r"my_featureclass"classFeatureProcessor(object):def__init__(self):# its placed in init cause we only want it to be run once and before any feature enters the writertry:
arcpy.RemoveFeatureClassFromTopology_management(topology, featureclass)
except Exception:
pass
definput(self,feature):self.pyoutput(feature)
defclose(self):
pass
# This is not code #Sh.. I don't know how to exit code snippet.
the we send every feature through the FeatureWriter
and to another pythonCaller:
import fme
import fmeobjects
import arcpy
from arcpy import env
env.workspace = r"H:\my_sde_connections\my.sde
topology = r"H:\my_sde_connections\my.sde\my_feature_dataset\my_topology"
featureclass = r"my_featureclass"
class FeatureProcessor(object):
def __init__(self):
arcpy.AddFeatureClassToTopology_management(topology, featureclass, 1, 1)
# here ranks are just set to 1
def input(self,feature):
self.pyoutput(feature)
def close(self):
pass
This add the featureclass back to the topology
any rules that were on the featureclass is gone, but I think it can be hardcoded back, maybe dynamically by asking for the first and storing them as attributes?
Here is an example of one of the topology definitions.
I've never been able to write to any feature class that was part of a topology defintion with FME, and I'm not sure if it's possible at all, regardless of how the topology has been configured.
I've never been able to write to any feature class that was part of a topology defintion with FME, and I'm not sure if it's possible at all, regardless of how the topology has been configured.
Thanks alot for your comment. Then i know for sure this has to do with the feature class beeing part of a topology definition. I will try to write a script the removes the feature class from the topology. and maybe write a script that recreates the topology at shutdown. I will post the answer if I manage i, if I don't there will be silence. Hehe
Thanks alot for your comment. Then i know for sure this has to do with the feature class beeing part of a topology definition. I will try to write a script the removes the feature class from the topology. and maybe write a script that recreates the topology at shutdown. I will post the answer if I manage i, if I don't there will be silence. Hehe
I'm sure there will be a lot of grateful people if you find a solution and share it here!
Ok, so these are the steps need for writing to an SDE with topology enabled:
I don't know why there is no transformers for this operation, but its quite simple.
First I have located where my featureclass is beeing part of a topology
And this is the hardcoded python script:
import fme
import fmeobjects
import arcpy
from arcpy import env
topology = r"H:\my_sde_connections\my.sde\my_feature_dataset\my_topology"
featureclass = r"my_featureclass"classFeatureProcessor(object):def__init__(self):# its placed in init cause we only want it to be run once and before any feature enters the writertry:
arcpy.RemoveFeatureClassFromTopology_management(topology, featureclass)
except Exception:
pass
definput(self,feature):self.pyoutput(feature)
defclose(self):
pass
# This is not code #Sh.. I don't know how to exit code snippet.
the we send every feature through the FeatureWriter
and to another pythonCaller:
import fme
import fmeobjects
import arcpy
from arcpy import env
env.workspace = r"H:\my_sde_connections\my.sde
topology = r"H:\my_sde_connections\my.sde\my_feature_dataset\my_topology"
featureclass = r"my_featureclass"
class FeatureProcessor(object):
def __init__(self):
arcpy.AddFeatureClassToTopology_management(topology, featureclass, 1, 1)
# here ranks are just set to 1
def input(self,feature):
self.pyoutput(feature)
def close(self):
pass
This add the featureclass back to the topology
any rules that were on the featureclass is gone, but I think it can be hardcoded back, maybe dynamically by asking for the first and storing them as attributes?
Ok, so these are the steps need for writing to an SDE with topology enabled:
I don't know why there is no transformers for this operation, but its quite simple.
First I have located where my featureclass is beeing part of a topology
And this is the hardcoded python script:
import fme
import fmeobjects
import arcpy
from arcpy import env
topology = r"H:\my_sde_connections\my.sde\my_feature_dataset\my_topology"
featureclass = r"my_featureclass"classFeatureProcessor(object):def__init__(self):# its placed in init cause we only want it to be run once and before any feature enters the writertry:
arcpy.RemoveFeatureClassFromTopology_management(topology, featureclass)
except Exception:
pass
definput(self,feature):self.pyoutput(feature)
defclose(self):
pass
# This is not code #Sh.. I don't know how to exit code snippet.
the we send every feature through the FeatureWriter
and to another pythonCaller:
import fme
import fmeobjects
import arcpy
from arcpy import env
env.workspace = r"H:\my_sde_connections\my.sde
topology = r"H:\my_sde_connections\my.sde\my_feature_dataset\my_topology"
featureclass = r"my_featureclass"
class FeatureProcessor(object):
def __init__(self):
arcpy.AddFeatureClassToTopology_management(topology, featureclass, 1, 1)
# here ranks are just set to 1
def input(self,feature):
self.pyoutput(feature)
def close(self):
pass
This add the featureclass back to the topology
any rules that were on the featureclass is gone, but I think it can be hardcoded back, maybe dynamically by asking for the first and storing them as attributes?
I don't recomend this. Its highly painful to recreate complex rules. And as far as I can see, arcpy delivers no module or function for loading a .rul file, so it looks like everything must be written in the code. I'm gonna vote for a transformer that does this.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.