IFeatureSelection,SelectFeatures throwing error.

5505
7
Jump to solution
01-26-2015 05:39 AM
Occasional Contributor II

Hello,

 

We have a simple code for selecting features based on attribute query using IFeatureSelection. However, it throws COMexception at the line where it selects the features. Error is Exception from HRESULT: 0x80041538.

 

Initially I suspected that problem would be with the syntax of the where clause, but even simpler where clauses like "OBJECTID = 500'" also throw error. I have confirmed that the features being queried actually exist in the feature class.Error screenshot is attached here.

 

Code:

Public Sub LayerSelectFeatures(ByRef pFlayer As IFeatureLayer, ByVal strFWhereClause As String, ByVal enumSelectionResult As esriSelectionResultEnum)           Try                         Dim pMxDoc As IMxDocument             pMxDoc = g_pApp.Document             Dim pMap As IMap             pMap = pMxDoc.FocusMap             Dim pActiveView As IActiveView             pActiveView = pMap               Dim pQueryFilter As IQueryFilter             pQueryFilter = New QueryFilterClass             pQueryFilter.WhereClause = strFWhereClause                          Dim pLayerSelection As IFeatureSelection             pLayerSelection = TryCast(pFlayer, ESRI.ArcGIS.Carto.IFeatureSelection)                              pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing)             pLayerSelection.SelectFeatures(pQueryFilter, esriSelectionResultEnum.esriSelectionResultAdd, False) 'Erractic Line             pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing)               System.Runtime.InteropServices.Marshal.ReleaseComObject(pQueryFilter)             pQueryFilter = Nothing           Catch ex As Exception           End Try       End Sub

 

ArcMap Version : 10.2.1

Database: SDE on Oracle 11 g

Language : VB.Net

 

I would appreciate if I can get help to fix this issue.

 

PS: When I use esriSelectionResultNew instead of esriSelectionResultAdd, it works.

 

Thanks.

Reply
0 Kudos
1 Solution

Accepted Solutions
Occasional Contributor II

Owen,

The line below did the trick.

GRANT UNLIMITED TABLESPACE TO <USERNAME>;

I guess you had guided me in that direction and I had tried it. but it did not work then. I had tried that through the UI of the Toad.

But I ran the above mentioned line in the Editor of the Toad and it did the trick.

Appreciate your help.

View solution in original post

7 Replies
New Contributor

I was getting that same error. I looked at the query filter string that I was sending and discovered a SQL error in it.

Reply
0 Kudos
Occasional Contributor II

Thanks for the response Jeff.

In my case, my where clause is correct, I have confirmed it.

Reply
0 Kudos
Occasional Contributor II

Hello,

I investigated this issue further and found that this error occurs while editing SDE feature class and not MDB or FGDB. To narrow down this,I enabled sde intercepts on my machine ( client ) and reproduced the error. The intercept produced large data to go through. Still, I found one oracle error that has been repeating itself.

This error was "ORA-01950: no privileges on tablespace 'USERS'. Below is some extract from the intercept.

[R 16:53:29.476] Command:      GetConnectionError

[W 16:53:29.476] Long:         -51

[W 16:53:29.476] Long:         1950

[W 16:53:29.476] NString:      "ORA-01950: no privileges on tablespace 'USERS'

ORA-06512: at line 1

So,I was wondering if anybody had got this error. Any help is appreicated.

S.

Reply
0 Kudos
Regular Contributor

From memory SDE stores feature classes selection sets within the database. You may want to look at this StackOverflow post about quotas. This is probably a long-shot but it is worth ruling out as a potential cause.

Reply
0 Kudos
Occasional Contributor II

Owen,

Thanks for your reply.

I gave unlimited  quota the table space to my user but it did not work.

Unlimited.jpg

This issue has something to do woth the grants and privillges I tihnk because when I give dba role to the user, the error does not occur.

Any other suggestions?

Thanks once again.

S.

Reply
0 Kudos
Regular Contributor

Definitely sounds like a permissions issue but you don't want to be handing out the dba role to all your users .

It has been a while since I have been involved in doing any SDE administration. Hopefully, someone with some more recent experience sees this and can make a suggestion.

I did find this old help file that explains what is created during the selection process - not sure if any of this has changed in version 10.

There is also this new help file that may provide some pointers. It also points to a potential issue with the user not having permissions for the Oracle tables used to store selection sets:

Tables created for shared log files

The log file tables used for this option are SDE_LOGFILES and SDE_LOGFILE_DATA. They are created in the schema of the connecting user the first time the user makes a selection that exceeds the selection threshold. For ArcGIS for Desktop, this threshold is 100 records.

SDE_LOGFILES stores information about each selection set (log file) that is created. The logfile_name and logfile_id columns in this table uniquely identify the name of the log file, and the logfile_id column links the log file record to the SDE_LOGFILE_DATA table. The SDE_LOGFILE_DATA table contains the logfile_data_id and the feature identifier for the selected records.

All records are deleted as soon as the selection set is cleared to prevent the SDE_LOGFILE_DATA table from growing too large. The SDE_LOGFILES table is truncated when the user's session ends. Both SDE_LOGFILE_DATA and SDE_LOGFILES remain in the user's schema.

Reply
0 Kudos
Occasional Contributor II

Owen,

The line below did the trick.

GRANT UNLIMITED TABLESPACE TO <USERNAME>;

I guess you had guided me in that direction and I had tried it. but it did not work then. I had tried that through the UI of the Toad.

But I ran the above mentioned line in the Editor of the Toad and it did the trick.

Appreciate your help.

View solution in original post