1

I’m using spring-data-couchbase with reactive approach & getting the following error:

The content of this Observable (viewRow) is already released. Subscribe earlier or tune the CouchbaseEnvironment#autoreleaseAfter()

Method definition

default Flux<NonPrimitiveAsset> findAssetByParameters(StringBuilder whereClause) {

  WherePath selectFrom = N1qlUtils
      .createSelectFromForEntity(getCouchbaseOperations().getCouchbaseBucket().name());

  Statement statement = selectFrom.where(whereClause.toString());

  N1qlQuery query = N1qlQuery.simple(statement, N1qlParams.build());
  return ReactiveWrapperConverters
      .toWrapper(getCouchbaseOperations().findByN1QL(query, NonPrimitiveAsset.class), Flux.class);

}

Caller method

Flux<NonPrimitiveAsset> assetFlux = repository.findAssetByParameters(whereClause);

Mono<List<NonPrimitiveAsset>> assetsMono = assetFlux.collectList()
Matthew Groves
  • 25,181
  • 9
  • 71
  • 121
  • That error only occurs in SDC 3.x and earlier. Can you upgrade to Spring Data Couchbase 4.x? – dnault Sep 23 '21 at 18:09

1 Answers1

0

I was facing the same issue. reindexing resolved the problem for me. Try to add indexes or reindex for that query.