您不能从processDisclosureData()调用persist(),因为它属于同一类,并且它将绕过Spring为InventoryDisclosureBO创建的事务代理。您应该从其他bean调用它以使@Transactional批注起作用。当Spring将对InventoryDisclosureBO
Bean的引用注入其他Bean时,它实际上是对InventoryDisclosureBOProxy的引用进行注入,该引用包含事务逻辑,例如
class Bean2 { @Autowire private InventoryDisclosureBO idbo; <-- Spring will inject a proxy here public void persist(InventoryDisclosureStatus data) {idbo.persist(data); <-- now it will work via proxy }...


