Skip to content

Document persisted despite throwing ConstraintViolationException on save. #1206

Closed
@fvalton

Description

@fvalton

An issue exists in the below versions of spring data and SDK whereby documents failing constraint validations are still persisted to Couchbase - despite these violations being picked up & printed to stderr.

Line 65 of ValidatingCouchbaseEventListener throws a new ConstraintViolationException when constraint violations are detected.

Further up the exception handling chain at line 186 of CouchbaseTemplateSupport the exception is swallowed and the stacktrace simply printed.

This allows the document to be saved to Couchbase even though it fails validation.

The exception should be propagated up the call chain to interrupt the save operation. This was the earlier behaviour in spring data 3.2.6.

Spring-Data: 4.2.4 (and 4.0.3)
Java SDK: 3.1.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: regressionA regression from a previous release

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions