Re: JPA DN5.2.0: fail to rollback on RuntimeException on PrePersist, PreUpdate


Andy
 
Edited

Better option (to isolate this particular situation from all other possible causes of RuntimeException being thrown during persist) would be to trap any RuntimeException from user callbacks, and rethrow as a NucleusUserCallbackException (or some name like that), with the RuntimeException nested inside it. Then "throwException" can check for NucleusUserCallbackException.

You can always provide a Pull Request.

Join main@datanucleus.groups.io to automatically receive all group messages.