How to perform asynchronous operations after the spring transaction is submitted. These asynchronous operations must be executed after the transaction is successfully submitted, and rollback will not be executed.
How to operate after the spring transaction is submitted
How to asynchronousize the operation
// send after tx commit but is asyncTransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { @Overridepublic void afterCommit() { System.out.println("send email after transaction commit..."); } } );
The above is the detailed content of How to do asynchronous operation after spring transaction commit. For more information, please follow other related articles on the PHP Chinese website!