Skip to content
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

Saving a record with an id that doesn't exist should return an error/warning to caller [DATAJDBC-438] #658

spring-projects-issues opened this issue Nov 1, 2019 · 1 comment
in: repository type: enhancement


Copy link

@spring-projects-issues spring-projects-issues commented Nov 1, 2019

Mike Wilkes opened DATAJDBC-438 and commented

I have a Repository defined, and an entity that has a generated Id. If I create an entity with an Id that doesn't already exist (nefarious, client issue, deleted by another client are all scenarios where this could reasonably happen), and call 'save' on the repository, the method returns the object unchanged, and gives no indication that a record was not updated.

Looking internally, it appears the action does not check the 'rows updated' return from the JdbcTemplate.update method, and by default, ignores warning exceptions from SQL.



The 'save' gives some indication that the update did not take please because the entity is not in the DB. Something as simple as the 'save' returning null, or it could throw an exception. No strong opinion here

Affects: 1.1 GA (Moore)

Referenced from: pull request #178, and commits 92b6b04, dfaf0ac

1 votes, 2 watchers

Copy link

@spring-projects-issues spring-projects-issues commented Nov 7, 2019

MyeongHyeonLee commented

I got same issue.

I requests PR for this issue to throw exception.


@spring-projects-issues spring-projects-issues added in: repository type: enhancement labels Dec 31, 2020
mp911de added a commit that referenced this issue Feb 21, 2022

We now correctly in initialize ReactiveQueryMethodEvaluationContextProvider in the repository factory bean. Previously, we used an empty instance of ReactiveQueryMethodEvaluationContextProvider that didn't consider registered extensions.

Closes #658
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: repository type: enhancement
None yet

No branches or pull requests

2 participants