@ApplicationModuleListener and Ignoring Exceptions · Issue #1187 · spring-projects/spring-modulith · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to have an event listener gracefully ignore DataIntegrityViolationException due to a unique key constraint. I want the event to be successfully completed.
I am trying to have an event listener gracefully ignore
DataIntegrityViolationException
due to a unique key constraint. I want the event to be successfully completed.I have the following listener declared:
The warehouse repository (for reference):
I've tried annotating the method like so to disable rollbacks and (hopefully) have the method execute successfully:
But that doesn't work either, since it yields the following error:
Application exception overridden by commit exception
I've also tried using
.saveAndFlush()
inside of the JPA repository instead of justsave()
, but that didn't work either.Is there a way to accomplish this kind of functionality?
The text was updated successfully, but these errors were encountered: