Jul 29th, 2012, 04:24 AM
Some way to intercept @Transactional method call after commit?
I know that @Transactional annotation is just a convenient way to construct TransactionProxyFactoryBean and other boilerplate configuration which allow for any type of customization, such as including custom interceptors, but I would like to keep using @Transactional *and* somehow specify somewhere in configuration to call my own interceptor so that I can do some stuff after transaction commits/rollbacks (outside of transaction).
Is that doable now?
Jul 29th, 2012, 04:59 AM
Have a look at TransactionSynchonizationManager and the TransactionSynchrionization interface.
Jul 29th, 2012, 12:46 PM
Simply execute your interceptor before the transactional one it is all about ordering and for that there is an order property on the tx:annotation-driven.
Aug 17th, 2012, 12:56 AM
Sample implementation of proposed solution can be found here:
Spring database transactions before sending JMS