Skip to content

Update transaction auto-configuration to backoff if a TransactionManager is defined #22851

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

Closed
snicoll opened this issue Aug 10, 2020 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Aug 10, 2020

Spring Framework 5.2 has introduced a parent for the PlatfromTransactionManager that's also a parent for the newly introduced ReactiveTransactionManager.

Our auto-configuration is checking the specific type at the moment. If we are auto-configuring a PlatformTransactionManager we check for that, and same for ReactiveTransactionManager for auto-configuring a reactive transaction manager.

The problem is that we can end up in a situation where we have two TransactionManager beans, a PlatformTransactionManager and a ReactiveTransactionManager. Considering that framework expects a single bean of that type for unqualified @Transactional use, I think we should refine our auto-configuration to avoid that by default.

This affects neo4j in particular as they ship both the imperative and reactive style in the same driver and the presence of Reactor on the classpath is the only trigger (which could be very common and for unrelated reasons, like using WebClient).

See also spring-projects/spring-framework#25532 and #22692

@snicoll snicoll added for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Aug 10, 2020
@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 10, 2020
@philwebb philwebb added this to the 2.4.x milestone Aug 10, 2020
@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label Aug 24, 2020
@snicoll snicoll self-assigned this Aug 25, 2020
@snicoll snicoll modified the milestones: 2.4.x, 2.4.0-M3 Aug 25, 2020
@snicoll
Copy link
Member Author

snicoll commented Aug 25, 2020

Spring Boot now backs off in the presence of a TransactionManager (vs. PlatformTransactionManager). This prevents that both an imperative and reactive transaction managers are auto-configured. See #22692 for a follow-up on the underlying issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants