In this section, you will learn about some of the important aspects of transaction management with a focus on declarative transaction management. Before going into the details of declarative transaction management, let's try and understand how Spring deals with transaction management.
Transaction management is primarily about defining a transaction boundary in relation to the following to ensure data consistency:
- When a transaction gets started
- Data being persisted
- When the transaction gets rolled back
- When the transaction is closed
Here are some of the key aspects of a Spring transaction boundary:
- Isolation: It represents the transaction boundary by determining the extent to which a transaction is isolated from other transactions.
- Propagation: It represents the scope of the transaction, for example, whether a code needs to be executed within a new transaction or continue executing within the existing transaction. In a later section, different transaction propagation is dealt...