问题描述:

在使用JPA执行删除操作时报错:

No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call; nested exception is javax.persistence.TransactionRequiredException: No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call

解决方法:

在对应的@Service或接口上添加@Transactional即可。

更多推荐

解决No EntityManager with actual transaction available for current thread