# An AFTER_COMMIT listener that inserts a row: three ways to declare it


--- no transaction attribute on the listener ---
inside the listener, right after the insert: audit row visible to other connections: false
after place() returned, order rows: 1
after place() returned, audit rows: 1

--- @Transactional(propagation = REQUIRES_NEW) on the listener ---
order rows: 1
audit rows: 1

--- @Transactional (REQUIRED, the default) on the listener ---
context started: false
failure chain: BeanInitializationException -> IllegalStateException
root cause: @TransactionalEventListener method must not be annotated with @Transactional unless when declared as REQUIRES_NEW or NOT_SUPPORTED: void com.ankurm.events.txwrite.required.AuditRequired.audit(com.ankurm.events.txwrite.shared.OrderPlaced)
