1@Service
2public class OrderService {
3
4 public void placeOrder(Order order) {
5 validate(order);
6 saveOrder(order);
7 }
8
9 @Transactional
10 public void saveOrder(Order order) {
11 orderRepository.save(order);
12 inventoryService.decrement(order.getItems());
13 }
14}
no lines flagged
#063PracticeMedium18 min · 120 XP
@Transactional Ignored on Self-Invocation
Calling a transactional method from another method in the same class silently runs without a transaction.
Flagged linesNo lines flagged yet
What's wrong?
Flag a line or write a note to submit.