Questions about the project encountered - trycatch manually roll back the transaction

try catch capture the transaction is not rolled back, but want to return to their own abnormal processing, and roll back the transaction how to do it.

The answer:. TransactionAspectSupport.currentTransactionStatus () setRollbackOnly (); # manually roll back abnormal

as follows:

Capture their own exception handling, and roll back the transaction and.

Guess you like

Origin www.cnblogs.com/yunliu0603/p/10960532.html