Spring transaction rollback BUG due to framework defect

what if the @ Transactional (rollbackFor=Exception.class) cannot be executed because of a framework defect
, and the
transaction cannot be rolled back?

clipboard.png

as shown in the figure, it is wrapped by me in try catch. An exception occurred after the execution of int swatches 1Universe 0. The previous data was deleted without performing deleteById, and the subsequent data was not deleted or rolled back.

Mar.04,2021

this is neither a framework defect nor a bug.
@ Transactional transaction rollback is implemented on AOP, and it will be rolled back only when an exception is thrown by the method.
you give the exception to try catch in the @ Transactional (rollbackFor=Exception.class) method. How can aop intercept the thrown exception? you have to re-throw the exception in catch before you can roll back.

  

finally write try catch in the UI layer

Menu