【Spring Data JPA】Database Exception

EmptyResultDataAccessException

deleteById(ID id)

  • Using deleteById(ID id) with @Transactional:
If the method is annotated with @Transactional, it might throw an EmptyResultDataAccessException if the entity doesn’t exist.
  • Using deleteById(ID id):
This method doesn’t throw an exception if the entity doesn’t exist. It silently does nothing.
Licensed under CC BY-NC-SA 4.0
Last updated on Feb 26, 2025 16:37 CST
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy