Transactional event listener invoked like standard event listener if @EnableTransactionManagement
not active
#32319
Milestone
@EnableTransactionManagement
not active
#32319
Assume this simple Boot application:
This will print
Event received!
upon startup, despite the event listener being declared as@TransactionalEventListener
and no transaction being active. That is because without@EnableTransactionManagment
, theDefaultEventListenerFactory
will see@EventListener
present as meta-annotation and thus create a standardApplicationListenerMethodAdapter
for the method. Activating@EnableTransactionManagement
, which is enabled in standard Boot applications as soon as any kind of data access technology is present, will cause the factory to be replaced byRestrictedTransactionalEventListenerFactory
which then causes the additional integration with the transaction infrastructure.The text was updated successfully, but these errors were encountered: