Skip to content

SimpleJpaRepository.deleteById throws EmptyResultDataAccessException #2719

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
dreis2211 opened this issue Dec 2, 2022 · 3 comments
Closed
Assignees
Labels
type: bug A general bug

Comments

@dreis2211
Copy link

Hi,

in spring-projects/spring-data-commons#2651 or more specifically in spring-projects/spring-data-commons#2651 (comment) it was announced that SimpleJpaRepository.deleteById shouldn't throw an exception if there is nothing to delete.

It also notes that the behaviour should have been adjusted in the various modules, but apparently it wasn't:

The behaviour of the various modules should get adopted for the 3.0 release.

Could this be still done even though 3.0.0 is already out now?

Cheers,
Christoph

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 2, 2022
@mp911de mp911de changed the title SimpleJpaRepository.deleteById throws EmptyResultDataAccessException SimpleJpaRepository.deleteById throws EmptyResultDataAccessException Dec 5, 2022
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 5, 2022
@gregturn gregturn added this to the 3.0.1 (2022.0.1) milestone Dec 5, 2022
gregturn added a commit that referenced this issue Jan 30, 2023
Comply with Spring Data Commons' new policy of not throwing an EmptyResultDataAccessException during deleteById.

Resolves: #2719.
Related: spring-projects/spring-data-commons#2651
@gregturn
Copy link
Contributor

I believe this was merged to main right after main rolled to 3.1.x. I've backported this fix to 3.0.x via 4a7126a.

@matusekma
Copy link

Hi @gregturn,

Thanks for the fix!
I believe this was not yet released. I tried to use deleteById on spring-data-jpa 3.0.1 according to the docs and it still throws EmptyResultDataAccessException.

Could you maybe release it?
Thank you!

@kylooh
Copy link

kylooh commented Nov 10, 2023

I believe this was merged to main right after main rolled to 3.1.x. I've backported this fix to 3.0.x via 4a7126a.

Any plane to merge this to current 2.7.x version?
I found 2.7.x is still active, and this version has been used in spring boot 2.7.17. And I met the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

6 participants