Skip to content

OptimisticLockingFailureException is not thrown by spring-data-couchbase but according to the documentation it should be thrown #1314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jorgerod opened this issue Feb 1, 2022 · 1 comment · Fixed by #1320
Labels
type: documentation A documentation update

Comments

@jorgerod
Copy link
Contributor

jorgerod commented Feb 1, 2022

Hi

OptimisticLockingFailureException is not thrown by spring-data-couchbase but according to the documentation it should be thrown

image

Instead it is throwing DataIntegrityViolationException caused by CasMismatchException.

if (ex instanceof CasMismatchException || ex instanceof ConcurrentModificationException
|| ex instanceof ReplicaNotConfiguredException || ex instanceof DurabilityLevelNotAvailableException
|| ex instanceof DurabilityImpossibleException || ex instanceof DurabilityAmbiguousException) {
return new DataIntegrityViolationException(ex.getMessage(), ex);
}

Is there an error in the documentation?

Related issue: #944 #934

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 1, 2022
@mikereiche
Copy link
Collaborator

mikereiche commented Feb 1, 2022

Looks like they don't match. The code has always translated CasMismatch to DataIntegrityViolation. Before that it didn't translate it. I suspect it's better to change the documentation than to break any code that handles the exception.

b9f23f3#diff-e82d83fa9ff4c9e5cef0a99873b87909a55f924adaecfdd2d40f880b9aa1fec6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
3 participants