| 
									
										
										
										
											2023-04-19 23:26:16 +08:00
										 |  |  | [[transaction]] | 
					
						
							|  |  |  | = Transaction Management | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Comprehensive transaction support is among the most compelling reasons to use the Spring | 
					
						
							|  |  |  | Framework. The Spring Framework provides a consistent abstraction for transaction | 
					
						
							|  |  |  | management that delivers the following benefits: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | * A consistent programming model across different transaction APIs, such as Java | 
					
						
							|  |  |  |   Transaction API (JTA), JDBC, Hibernate, and the Java Persistence API (JPA). | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:17 +08:00
										 |  |  | * Support for xref:data-access/transaction/declarative.adoc[declarative transaction management]. | 
					
						
							|  |  |  | * A simpler API for xref:data-access/transaction/programmatic.adoc[programmatic] transaction management | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:16 +08:00
										 |  |  |   than complex transaction APIs, such as JTA. | 
					
						
							|  |  |  | * Excellent integration with Spring's data access abstractions. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-06 20:59:44 +08:00
										 |  |  | The following sections describe the Spring Framework's transaction features and technologies: | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:16 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-06 20:59:44 +08:00
										 |  |  | * xref:data-access/transaction/motivation.adoc[Advantages of the Spring Framework's transaction support model] | 
					
						
							|  |  |  |   describes why you would use the Spring Framework's transaction abstraction instead of EJB | 
					
						
							|  |  |  |   Container-Managed Transactions (CMT) or choosing to drive transactions through a proprietary API. | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:17 +08:00
										 |  |  | * xref:data-access/transaction/strategies.adoc[Understanding the Spring Framework transaction abstraction] | 
					
						
							| 
									
										
										
										
											2023-08-06 20:59:44 +08:00
										 |  |  |   outlines the core classes and describes how to configure and obtain `DataSource` instances | 
					
						
							|  |  |  |   from a variety of sources. | 
					
						
							|  |  |  | * xref:data-access/transaction/tx-resource-synchronization.adoc[Synchronizing resources with transactions] | 
					
						
							|  |  |  |   describes how the application code ensures that resources are created, reused, and cleaned up properly. | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:17 +08:00
										 |  |  | * xref:data-access/transaction/declarative.adoc[Declarative transaction management] describes support for | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:16 +08:00
										 |  |  |   declarative transaction management. | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:17 +08:00
										 |  |  | * xref:data-access/transaction/programmatic.adoc[Programmatic transaction management] covers support for | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:16 +08:00
										 |  |  |   programmatic (that is, explicitly coded) transaction management. | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:17 +08:00
										 |  |  | * xref:data-access/transaction/event.adoc[Transaction bound event] describes how you could use application | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:16 +08:00
										 |  |  |   events within a transaction. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The chapter also includes discussions of best practices, | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:17 +08:00
										 |  |  | xref:data-access/transaction/application-server-integration.adoc[application server integration], | 
					
						
							|  |  |  | and xref:data-access/transaction/solutions-to-common-problems.adoc[solutions to common problems]. | 
					
						
							| 
									
										
										
										
											2023-04-19 23:26:16 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 |