Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid opening a transaction for event externalization #859

Closed
odrotbohm opened this issue Oct 6, 2024 · 0 comments
Closed

Avoid opening a transaction for event externalization #859

odrotbohm opened this issue Oct 6, 2024 · 0 comments
Assignees
Labels
in: event publication registry Event publication registry type: improvement Minor improvements
Milestone

Comments

@odrotbohm
Copy link
Member

The DelegatingEventExternalizer currently uses @ApplicationModuleListener to asynchronously publish events to a broker on transaction commit. That said, @AML creates a transaction itself, which is unnecessary in this case as the listener solely interacts with infrastructure that's not transactional in the first place.

To avoid a connection unnecessarily being acquired, we should flip the transaction propagation to SUPPORTS, i.e., not actively creating a transaction but simply participating in one in case some infrastructure still creates one.

@odrotbohm odrotbohm added the in: event publication registry Event publication registry label Oct 6, 2024
@odrotbohm odrotbohm added this to the 1.3 RC1 milestone Oct 6, 2024
@odrotbohm odrotbohm self-assigned this Oct 6, 2024
odrotbohm added a commit that referenced this issue Oct 6, 2024
We now use the ability to override transaction propagation introduce for GH-858 to tweak the application module listener declaration on DelegatingEventListener so that we do not create a transaction by default. This avoids a database connection being acquired as the listener is very likely to interact with a non-transactional resource anyway.
@odrotbohm odrotbohm added the type: improvement Minor improvements label Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: event publication registry Event publication registry type: improvement Minor improvements
Projects
None yet
Development

No branches or pull requests

1 participant