Spring Transaction Management
Spring Transaction Management
Transaction Sucessfull
Commit
Initial
State Transaction
Transaction Failed
RollBack
try{
1) begin transaction
2) own business logic
3) commit transaction
}
catch(Exception){
rollback transaction
throw exception
}
Pros:
Cons:
Pros:
In the repository you find the example Where there are the two
repositories Patient and Appointment
When you trying to save the appointment after patient and that time If the
excpetion occurs then the whole transaction will rollback even the patient
data also.