| 
									
										
										
										
											2023-04-19 23:26:16 +08:00
										 |  |  | [[transaction-solutions-to-common-problems]] | 
					
						
							|  |  |  | = Solutions to Common Problems | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:17 +08:00
										 |  |  | :page-section-summary-toc: 1 | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:16 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | This section describes solutions to some common problems. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [[transaction-solutions-to-common-problems-wrong-ptm]] | 
					
						
							|  |  |  | == Using the Wrong Transaction Manager for a Specific `DataSource` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Use the correct `PlatformTransactionManager` implementation based on your choice of | 
					
						
							|  |  |  | transactional technologies and requirements. Used properly, the Spring Framework merely | 
					
						
							|  |  |  | provides a straightforward and portable abstraction. If you use global | 
					
						
							|  |  |  | transactions, you must use the | 
					
						
							|  |  |  | `org.springframework.transaction.jta.JtaTransactionManager` class (or an | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:17 +08:00
										 |  |  | xref:data-access/transaction/application-server-integration.adoc[application server-specific subclass] of | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:16 +08:00
										 |  |  | it) for all your transactional operations. Otherwise, the transaction infrastructure | 
					
						
							|  |  |  | tries to perform local transactions on such resources as container `DataSource` | 
					
						
							|  |  |  | instances. Such local transactions do not make sense, and a good application server | 
					
						
							|  |  |  | treats them as errors. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 |