Problem: ArcGIS clients encounter errors related to table schema changes, app domain unloading, or fetch buffers when working with SQL Server native spatial types
When editing or displaying spatial data stored using SQL Server native spatial types, ArcGIS client applications may encounter the following errors:
Error: Could not complete cursor operation because the table schema changed after the cursor was declared.
Error: The app domain with specified version id (%d) was unloaded due to memory pressure and could not be found.
Error: [Microsoft][SQL Server Native Client 11.0][SQL Server]There are no rows in the current fetch buffer.
In the SQL Server error logs, the error is usually related to memory pressure forcing the Common Language Runtime (CLR) application domain to unload.
Note: By default, the error log is found in the following folder location: C:\Program Files\Microsoft SQL Server\MSSQL##.MSSQLSERVER\MSSQL\Log
Microsoft SQL Server spatial data types (Geometry and Geography) are implemented as CLR data types. When the application domain hosting the spatial data type structures is unloaded, the engine treats this as a schema change to the underlying objects referenced in the cursor. As a result, spatial queries while displaying and editing layers stored using either geometry or geography types may fail with related error messages when the schema change is detected.
Solution or Workaround
Microsoft has released cumulative updates containing fixes that were released after the initial release of SQL Server and include the fix for the issue described in this article. The fixes for Microsoft SQL Server releases 2016, 2017, and 2019 can be found at the following links:
- Cumulative Update 13 for SQL Server 2016 SP2
- Cumulative Update 21 for SQL Server 2017
- Cumulative Update 5 for SQL Server 2019
Note: This article was previously documented as KB 43036.