TransactionSystemException:无法提交JPA事务;
16lz
2021-01-22
I face this problem when I update one of the database table fields:
我更新其中一个数据库表字段时遇到此问题:
org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction"
1 个解决方案
#1
This may be happening due to number of reasons. But one of the common causes for this problem is to forget annotating one of the methods used in update process as @Transactional
. Can this be the case by any chance?
这可能由于多种原因而发生。但是这个问题的常见原因之一是忘记将更新过程中使用的一种方法注释为@Transactional。任何机会都可以这样吗?