Improve documentation to clarify coordination of multiple transaction managers

Author: quaffCreated Apr 21, 2026Updated Sep 5, 2026
Labelsstatus: waiting-for-triagetype: documentation

Given two transaction managers tm1 and tm2, it's unclear that a transaction created by tm2 will or not participate in an existing transaction created by tm1. According to my investigation, the answer is yes if they share the same underlying resource, such as DataSourceTransactionManager for example:

	@Test
	public void test(@Autowired DataSource dataSource) {
		
		DataSourceTransactionManager tm1 = new DataSourceTransactionManager(dataSource);
		DataSourceTransactionManager tm2 = new DataSourceTransactionManager(dataSource);
		
		TransactionTemplate tt1 = new TransactionTemplate(tm1);
		TransactionTemplate tt2 = new TransactionTemplate(tm2);
		
		tt1.executeWithoutResult(s1 -> {
			assertThat(s1.isNewTransaction()).isTrue();
			tt2.executeWithoutResult(s2 -> {
				assertThat(s2.isNewTransaction()).isFalse();
			});
		});
	}

It would be nice if the reference manual expounded on it and the Javadoc mentioned it.

Source: spring-projects/spring-framework