r2dbc/r2dbc-mssql

Cursors are not supported on a table which has a clustered columnstore index

jbgess opened this issue · 1 comments

Versions

  • r2dbc-mssql version: 0.9.0-RELEASE
  • Java: openjdk-17 1.13

Issue

Cannot get data from a table with a columnstore index when using MssqlConnectionFactory.

When trying to execute a query I am getting the error:
Cursors are not supported on a table which has a clustered columnstore index.; nested exception is io.r2dbc.mssql.ExceptionFactory$MssqlNonTransientException: [35370] [S0001] Cursors are not supported on a table which has a clustered columnstore index.

The query I am trying to execute has this structure:
SELECT TOP 1000 * FROM <table_name> ORDER BY <date_field> DESC

The queries are being executed using spring-r2dbc DatabaseClient (v5.3.22) with a MssqlConnectionFactory.

What I have tried

Setting the option preferCursoredExecution to use direct. Which I believe it should be using by default. To set the property I have tried the few different approaches suggested in the documentation. e.g.:

  • ConnectionFactoryOptions
  • MssqlConnectionConfiguration.builder()

Setting the options value with boolean vs Predicate<String>.

Connecting to the database directly and changing the selectMethod between cursor and direct. When using direct the data is returned successfully. When using cursor I get the exception as expected.

With #267 we removed another code path that might have led to cursor usage. Care to update to the newest version and retry with your custom Predicate?