-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed as not planned
Closed as not planned
Copy link
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fix
Description
In the following example, when the POST /foo/test1 endpoint is called, the entity will be saved to the database. However, calling POST /foo/test2 will not trigger any updates.
`
@RestController
@RequestMapping("/foo")
public class FooController {
@Autowired
BarService barService;
@PersistenceContext
EntityManager entityManager;
@PostMapping("/test1")
public void post1() {
System.out.println("\n".repeat(10));
FileEntity fileEntity = entityManager.find(FileEntity.class, 2L);
fileEntity.setDescription(fileEntity.getDescription() + "-1");
barService.bar();
}
@Transactional(Transactional.TxType.SUPPORTS)
@PostMapping("/test2")
public void post2() {
System.out.println("\n".repeat(10));
FileEntity fileEntity = entityManager.find(FileEntity.class, 2L);
fileEntity.setDescription(fileEntity.getDescription() + "-1");
barService.bar();
}
}
@Service
public class BarService {
@Transactional(Transactional.TxType.REQUIRES_NEW)
public void bar() {
System.out.println("log");
}
}
`
I expect that no updates occur in either call
Metadata
Metadata
Assignees
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fix