Skip to content

Correct behaviour of NOOP deletes to match the specification in CrudRepository #1313

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
schauder opened this issue Aug 25, 2022 · 0 comments
Closed
Labels
type: enhancement A general enhancement

Comments

@schauder
Copy link
Contributor

See: spring-projects/spring-data-commons#2651

schauder added a commit that referenced this issue Aug 25, 2022
…epository.

Delete operations that receive a version attribute throw an `OptimisticFailureException` when they delete zero rows.
Otherwise, the NOOP delete gets silently ignored.

Note that save operations that are determined to be an update because the aggregate is not new will still throw an `IncorrectUpdateSemanticsDataAccessException` if they fail to update any row.
This is somewhat asymmetric to the delete-behaviour.
But with a delete the intended result is achieved: the aggregate is gone from the database.
For save operations the intended result is not achieved, hence the exception.

Closes #1313
See spring-projects/spring-data-commons#2651
@mp911de mp911de added the type: enhancement A general enhancement label Aug 31, 2022
@mp911de mp911de added this to the 2.4.3 (2021.2.3) milestone Aug 31, 2022
mp911de pushed a commit that referenced this issue Aug 31, 2022
…epository`.

Delete operations that receive a version attribute throw an `OptimisticFailureException` when they delete zero rows.
Otherwise, the NOOP delete gets silently ignored.

Note that save operations that are determined to be an update because the aggregate is not new will still throw an `IncorrectUpdateSemanticsDataAccessException` if they fail to update any row.
This is somewhat asymmetric to the delete-behaviour.
But with a delete the intended result is achieved: the aggregate is gone from the database.
For save operations the intended result is not achieved, hence the exception.

Closes #1313
Original pull request: #1314.
See spring-projects/spring-data-commons#2651
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
2 participants