【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 Jul 18, 2024 00:00 UTC
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy