Skip to content

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

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
spring-projects-issues opened this issue Nov 1, 2019 · 1 comment
Assignees
Labels
in: repository Repositories abstraction type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

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.

 

+Expected+

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

@spring-projects-issues
Copy link
Author

MyeongHyeonLee commented

I got same issue.

I requests PR for this issue to throw exception.

#178

@spring-projects-issues spring-projects-issues added in: repository Repositories abstraction type: enhancement A general enhancement labels Dec 31, 2020
mp911de added a commit that referenced this issue Feb 21, 2022
…dbcRepositoryFactoryBean.

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
Labels
in: repository Repositories abstraction type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants