Skip to content

Add documentation about multiple transaction managers sharing same resource - #36688

Closed
Arbaz4Sayyad wants to merge 1 commit into
spring-projects:mainfrom
Arbaz4Sayyad:issue-36684-multiple-transaction-managers
Closed

Add documentation about multiple transaction managers sharing same resource#36688
Arbaz4Sayyad wants to merge 1 commit into
spring-projects:mainfrom
Arbaz4Sayyad:issue-36684-multiple-transaction-managers

Conversation

@Arbaz4Sayyad

Copy link
Copy Markdown

Fixes #36684

This PR adds documentation to clarify the behavior when multiple DataSourceTransactionManager instances are configured with the same underlying DataSource.

Changes
Javadoc Update
Added a new paragraph to DataSourceTransactionManager class Javadoc explaining that:

When multiple transaction managers share the same DataSource, transactions created by one manager can participate in existing transactions created by another manager
This behavior occurs because transaction synchronization is based on the resource itself, not the transaction manager instance
Example: if tm1 starts a transaction and tm2 (with same DataSource) begins a transaction with PROPAGATION_REQUIRED, it will join the existing transaction
Reference Documentation Update
Added a new section "Multiple Transaction Managers with the Same Resource" in strategies.adoc that includes:

Explanation of the coordination behavior
Code example demonstrating two transaction managers sharing the same DataSource
Clarification that coordination happens through TransactionSynchronizationManager
Use case description for when this behavior is useful
Testing
No code changes required - this is a documentation-only update that clarifies existing behavior.

…source

Addresses spring-projects#36684 by clarifying that when multiple DataSourceTransactionManager
instances are configured with the same DataSource, transactions created by one
manager can participate in existing transactions created by another manager.

Changes:
- Add Javadoc to DataSourceTransactionManager explaining the behavior
- Add reference documentation section with code example
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 22, 2026
@bclozel bclozel added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 22, 2026
@sbrannen

sbrannen commented Sep 5, 2026

Copy link
Copy Markdown
Member

@sbrannen sbrannen added status: duplicate A duplicate of another issue type: documentation A documentation task and removed status: declined A suggestion or change that we don't feel we should currently apply labels Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: duplicate A duplicate of another issue type: documentation A documentation task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve documentation to clarify coordination of multiple transaction managers

4 participants