Skip to content

Support listener registration for @Transactional triggered method rollbacks #36073

@jhoeller

Description

@jhoeller

Following up on #35382 and #36072, we can support a MethodRollbackEvent in TransactionInterceptor, analogous to MethodRetryEvent and reusing the generalized MethodFailureEvent as a superclass.

For every exception triggering a rollback, TransactionInterceptor publishes a MethodRollbackEvent, even for reactive transactions. This complements existing facilities such as TransactionExecutionListener which have finer-grained callbacks but lack the method invocation context.

Like with MethodRetryEvent, our assumption is that failure logging/metrics is much more common than fine-grained interception at each step of retry/transaction processing. Also, such a logging/metrics arrangements specifically benefits from the availability of the method invocation context.

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions