No EntityManager with actual transaction available for current thread - cannot reliably process 'rem

悠悠 2023-06-23 13:26 87阅读 0赞

调用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即可

发表评论

表情:
评论列表 (有 0 条评论,87人围观)

还没有评论,来说两句吧...

相关阅读