Issues with BasicFeatureLayer.Select()

706
5
06-13-2018 02:54 AM
BartVan_Hoecke
New Contributor II

Hi,

In our AddIn we are trying to use the BasicFeatureLayer.Select to select/highlight some features on the map. This works great in most cases , but apparently were are bumping into some limitation. We receive a ArcGIS.Core.Data.GeodatabaseException ("a geodatabase exception occured") with HRESULT: 0x80050120 and StackTrace:

at ArcGIS.Core.Internal.ISelectionIOP.Selection_Combine(IntPtr selectionHandle, IntPtr otherSelectionHandle, SetOperation setOperation)
at ArcGIS.Core.Data.Selection.Combine(Selection otherSelection, SetOperation setOperation)

Does anyone know what is leading to this? Is it the number of features being selected (around 150 in this test). 

We've also tried to make the select in blocks using the SelectionCombinationMethod.New and Add together. The issue remails.

Thanks,

Bart

0 Kudos
5 Replies
RichRuh
Esri Regular Contributor

Hi Bart,

I wrote a few lines of code and was able to select 500 features using FeatureLayer.Select(queryFilter, SelectionCombinationMethod.Add), where the queryFilter returned 200 rows at a time.  

This was with a feature service workspace.  Could you tell me more about what kind of data source you were using, and how you went about selecting the records?  Code snippets would be fine.

Thanks,

--Rich

0 Kudos
BartVan_Hoecke1
New Contributor

Hi Rich,

Thanks for the test. Yeah, seems like it's not merely the number of features that's taking part in this issue.

But:

- I'm using a direct Database connection (Oracle 12c)

- I had added 3 registed Feature Classes (1 point, 2 polylines).

- To select, a QueryFilter is being build up, which we pass on to the Select method. The QueryFilter uses a list of internal ID's to filter on (not the OID field).

Snippet:

QueryFilter queryFilter = new QueryFilter();
queryFilter.WhereClause = string.Format("ID IN ({0})",  inclause);

inclause being something like :  "100102,100103,100104,100105,100106,100107"

We've been using this for some time now. Never noticed any issues with it. Field is indexed and so on. Never measures how many features could be selected in group. 

Could it be related to the feature data itself, for instance the geometry?

Thanks,

Bart

0 Kudos
RichRuh
Esri Regular Contributor

So there's an Oracle limitation with 1000 clauses in an "in" clause, but you're failing with a much smaller number of records, right?

Do you have a reproducible case that you can send to support?

--Rich

0 Kudos
BartVan_Hoecke
New Contributor II

Hi Rich,

Indeed, we are facing an issue quite below that Oracle limitation.

I'll try to provide a set of data and a code snippet.

Kind regards,

Bart

0 Kudos
BartVan_Hoecke
New Contributor II

Hi Rich,

While preparing the dataset export, we noticed that the issue was not occurring with the local gdb dataset. So we did a few extra tests like copying the feature class. All with success, so it seems like we have an error in the table registration (SDE_XML_DOC1?)

Thank you!

0 Kudos