Đang mở hậu trường...
Chọn đáp án để xem tỉ lệ cộng đồng và giải thích. Câu hỏi được chọn tự động — mọi người cùng làm 1 câu mỗi ngày.
In a Spring Boot service, a fresher writes the following code: @Service public class OrderService { public void processAll(List<Order> orders) { for (Order o : orders) { saveOne(o); // direct call to method in the same class } } @Transactional public void saveOne(Order o) { orderRepository.save(o); } } When processAll() is called from a controller and saveOne() throws a RuntimeException midway, the already-saved rows are NOT rolled back. What is the main reason?