Skip to content

Using CoucbaseRepository.delete() causes @Transactional methods to error #1725

Closed
@sf-eng

Description

@sf-eng

I'm using spring-data-couchbase 5.0.5 with spring boot 3.0.6.

When attempting to execute a service method marked @transactional which uses a CouchbaseRepository.delete call, the transaction fails with the error:
"cas must be supplied for tx remove".

I think I tracked this down to the SimpleCouchbaseRepository class's delete() implementation not supplying the .withCas() method.
To work around this I've implemented my own custom repository extension with a void deleteTx(T entity) which does employ the .withCas() method.

Is there a better supported way to use repository delete methods in @transactional blocks?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions