Select to view content in your preferred language

REST API query crashing Server/RDS/STBDS

1173
2
03-10-2021 10:05 AM
AMusingFool
Emerging Contributor

Hi,

I'm trying to test out a couple different query options, and I ran into a weird problem.  I'm running this query via the ArcGIS API for Python, though (unsurprisingly) I can duplicate it via the REST API.

I'm doing a spatial query on a line feature service, defined as an intersection filter:

{'geometry': {'x': -77.1316680684686, 'y': 38.9058418292552, 'spatialReference': {'wkid': 4326}}, 'geometryType': 'esriGeometryPoint', 'spatialRel': 'esriSpatialRelIntersects', 'inSR': {'wkid': 4326}}

The query, in python, looks like:

lineNearCount = pieceLayer.query(where=whereClause, return_count_only=True,
geometry_filter=arcgis.geometry.filters.intersects(geom, sRef),
distance=500, units='esriSRUnit_Meter')

It works fine, for the most part, but if whereClause is too long (at least, I assume that's what's causing the problem; the one in question is around 44k.  I will attach), then it generates a no-detail 'Database Error'.  Looking further, it consistently disconnects the Server from the Relational and/or SpatioTemporal DataStore (that is, Server will be unable to validate at least one of the DataStores, but the DataStores will still report being connected). I haven't found a way to remedy except by restarting the Server (and, sometimes, one of the DataStores).  FWIW, the feature service being queried is on the STBDS.

I'll try again with a shorter where clause (maybe just under 32k), but that's a pain since it takes at least five minutes to reset everything.

Tags (2)
0 Kudos
2 Replies
AMusingFool
Emerging Contributor

Small update.  It isn't a 32k thing.  Same results with same where clause truncated to 32015 bytes.

0 Kudos
AMusingFool
Emerging Contributor

Looks like the limit might be 16k; shortening to just under that did work correctly.

0 Kudos