Commit ff2c19c
GH-36684: Document transaction coordination between managers sharing a DataSource
Two DataSourceTransactionManager instances configured with the same
DataSource object participate in the same JDBC connection and physical
transaction. This follows from both managers using the same
TransactionSynchronizationManager key (the DataSource instance), so the
second getTransaction() call detects and joins the existing connection.
This shared-DataSource behavior was previously undocumented, leading to
confusion about whether multiple transaction managers can truly coordinate.
Add a Javadoc paragraph to DataSourceTransactionManager explaining the
behavior and when to prefer separate DataSource instances or JTA.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 5e5d299 commit ff2c19c
1 file changed
Lines changed: 11 additions & 0 deletions
File tree
- spring-jdbc/src/main/java/org/springframework/jdbc/datasource
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
109 | 120 | | |
110 | 121 | | |
111 | 122 | | |
| |||
0 commit comments