Skip to content

@TransactionalEventListener should not receive an event if no transaction is active #23276

@clembo590

Description

@clembo590

when a component method is annotated with @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT), no event should be received from a code block annotated with @Transactional(propagation = Propagation.NOT_SUPPORTED)

I made a very small spring boot project that shows the issue:
2 Test methods in that project:

@Test public void notTransactional() --> WORKS OK (no transactional event is received)
@Test public void notSupported() --> (KO: an event is received and it should not be because the block from witch the event is send is a propagation=NOT_SUPPORTED block)

com.cbo.transac.zip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions