POST
|
So after thinking about this a little bit more I realize I don't understand the threading model in CoreHost. Since all CoreHost applications must be in single threaded apartment (STA) mode I assumed that QueuedWorker.Run was there so you didn't block the main thread and break the STA contract which, very basically is to not block the thread and not to deadlock. Why would attempting to create a difference cursor in the MTA CLR threadpool (I'm assuming that's what QueuedWorker.Run does) cause it to behave differently than in the STA? If I wrap my function in QueuedWorker.Run it continues to give me the "Object has no schema locks" error. Should I just not use QueuedWorker when creating CoreHost/STAThread applications?
... View more
08-07-2020
09:09 AM
|
0
|
1
|
1662
|
POST
|
Thank you Rich, I was trying to do this in QueuedWorker.Run. Removing that allowed it to work. The documentation mentions that the Differences cursor must be created on the MCT so I thought the same would apply in a CoreHost application. It appears that it does not.
... View more
08-06-2020
12:19 PM
|
0
|
0
|
1662
|
POST
|
I was trying to do this in CoreHost. After moving my code over to a Pro addin module, it creates the difference cursor just fine. Do you know if CoreHost supports difference cursors and/or what I might need to do diffrently to get them to work in a CoreHost application?
... View more
07-22-2020
12:54 PM
|
0
|
5
|
1662
|
POST
|
1. I'm using ArcGIS Pro 2.5.2 2. All version names and tables are correct. I am able to open a RowCursor on both the versioned and default feature classes 3. I can see version changes in the Pro interface In Fiddler, I can see the call to startReading when I open the differences tab in Pro. I do not see any such call to startReading in Fiddler when I try my code. setting a breakpoint on the call to GetVersions shows it calling the following endpoints VersionManagementServer/versionInfos FeatureServer/relationships VersionManagementServer/versions/GUID-To-Version (does this for all versions since I'm calling version.GetName() on them) on line 26 in the code above where I create the difference cursor, I get this. One thing different that I'm doing compared to the Pro SDK documentation, is creating the geodatabase using ServiceConnectionProperties and the url of the feature service. ServiceConnectionProperties serviceConnectionProperties = new ServiceConnectionProperties(
new Uri(https://<server_url>/server/rest/services/<feature_service_name>/FeatureServer));
... View more
07-22-2020
11:12 AM
|
0
|
0
|
1662
|
POST
|
I'm trying to use a DifferenceCursor on a utility network feature service geodatabase. I am following the guide here I am able to use the VersionManager class to open the default geodatabase and the version geodatabase and then open the same feature class from both of them. However, when I try to create a DifferenceCursor I get this error "Object has no schema locks". I dug into this a bit further via the VersionManagerServer rest endpoints. If you go to https://<server_url>/rest/services/<feature_server>/VersionManagementServer/versions/<version_guid>/differences and try to run it you get the same error: This can be overcome by running the startReading command Then you can go back to the differences endpoint, put the same sessionId in and it works. It doesn't look like VersionManager does this first step of starting a read session. Here's a snippet of the code I'm using. ServiceConnectionProperties serviceConnectionProperties = new ServiceConnectionProperties(new Uri(config.Connection.UtilityServiceUri));
using (Geodatabase gdb = new Geodatabase(serviceConnectionProperties))
using (VersionManager versionManager = gdb.GetVersionManager())
{
//here's where I was going to try calling the startReading operation directly off the ReST endpoint
WebClient versionManagerClient = new WebClient()
{
BaseAddress = config.Connection.UtilityServiceUri + "/VersionManagementServer"
};
Version navigateVersion = versionManager.GetVersions().First(v => v.GetName() == config.ApplicationConfiguration.NavigateVersion);
using (Geodatabase navigateGdb = navigateVersion.Connect())
{
foreach (string featureClass in config.FeatureClasses)
{
//service feature classes have the layer number prefix i.e L0PipelineLine
//so we use this function to translate between human readable and the actual layer name
FeatureClassDefinition serviceFCDefinition = GetServiceFeatureClassName(featureClass);
string serviceFeatureClassName = serviceFCDefinition.GetName();
FeatureClass defaultFc = gdb.OpenDataset<FeatureClass>(serviceFeatureClassName);
FeatureClass navigateFc = navigateGdb.OpenDataset<FeatureClass>(serviceFeatureClassName);
//this line gives me "Object has no schema locks"
DifferenceCursor diffCursor = navigateFc.Differences(defaultFc, DifferenceType.Insert);
while (diffCursor.MoveNext())
{
using (Row row = diffCursor.Current)
{
log.Append(String.Format("Post Change: insert into geometry_changes ({0}) values()",
String.Join(", ", outputFields)));
}
}
}
}
}
... View more
07-21-2020
02:03 PM
|
0
|
8
|
1804
|
Online Status |
Offline
|
Date Last Visited |
09-23-2022
04:28 PM
|