"Internal error exception" on QueryAsync

2998
2
04-08-2015 12:16 PM
AshleyDePottey
New Contributor II

I am experiencing a problem with the FeatureTable.QueryAsync method that is proving very difficult to troubleshoot.  I am using the SpatialQueryFilter to find all features that intersect a geometry, and *occasionally*, the QueryAsync method throws a super generic exception.  There are certain areas that seem to be more problematic but I cannot pin down anything specific about the data there, and some geometries return results without error. Has anyone seen this or have any tips for troubleshooting an issue like this?

My code:

// find correct feature table:
FeatureTable targetTable = null;
IEnumerable<FeatureTable> matchTables = _defaultGDB.FeatureTables.Where(table => table.Name.Equals(_parcelTableName, StringComparison.OrdinalIgnoreCase));
if (matchTables.Count() > 0)
  {
  targetTable = matchTables.First();
  }
  else {
  throw new Exception("The default query table could not be found.");
  }
}

// Define a spatial query
var filter = new Esri.ArcGISRuntime.Data.SpatialQueryFilter();
filter.Geometry = GeometryEngine.Project(geom, targetTable.SpatialReference);
filter.SpatialRelationship = SpatialRelationship.Intersects;

// Execute the query and await results
var results = await targetTable.QueryAsync(filter);

And my exception:

System.Exception was caught

  HResult=-2146233088

  Message=Internal error exception

  Source=Esri.ArcGISRuntime

  StackTrace:

       at RuntimeCoreNet.Interop.HandleException(Boolean retVal)

       at RuntimeCoreNet.CoreFeatureSource.Query(CoreQueryFilter queryFilter)

       at Esri.ArcGISRuntime.Data.ArcGISFeatureTable.<>c__DisplayClass24.<QueryAsync>b__23()

       at System.Threading.Tasks.Task`1.InnerInvoke()

       at System.Threading.Tasks.Task.Execute()

    --- End of stack trace from previous location where exception was thrown ---

0 Kudos
2 Replies
EdwardBlair
Occasional Contributor

For what its worth, I've run into nearly the same condition and same very generic error message.

I thought I had seen some description of a "Known Issue" where QueryAsync could fail in 10.2 with large datasets, but now I can't seem to locate that reference.

Ed

0 Kudos
EdwardBlair
Occasional Contributor

At this point I am 99% certain that my problem is that the query is operating on a runtime feature table that contains polylines with parametric curves.   When I use the same query on point features I do not see the problem.  Any given the fact that when using the query on polylines the issue was sporadic and unpredictable makes me think curves were the issue.

Unfortunate that runtime doesn't support these things... or at least provides a clearer error when they're present.

Ed

0 Kudos