Grokking Spring Boot
0% completed
What a Transaction Guarantees
We ran the same booking request twice against the booking service. Each time, Ben asked for seat A12 at event 7, the service saved his booking, and then the payment provider declined his card. The only difference between the two runs was one annotation on the service method. These are the counts that the test printed afterwards:
| BookingService.book | Bookings left in the table after the declined payment |
|---|---|
| Without @Transactional | 1 |
| With @Transactional | 0 |
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%