Spring 3.0.4-RELEASE、JPA 2.0 を Hibernate をプロバイダーとして使用し、JTA JOTM をアプリケーションのトランザクションに使用しています。entityManager.merge
エンティティ オブジェクトを呼び出すと、次のエラーが発生しました。
org.objectweb.jotm.SubCoordinator commit_one_phase
INFO: Rollback during beforeCompletion in SubCoordinator.commit_one_phase
org.springframework.transaction.UnexpectedRollbackException: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException
at
org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1012)
このエラーは、Talend ETL ジョブを介してデータベース (MySQL) にデータを直接挿入した結果として発生しました。@Version
データベース内の列に値があることに気付き、NULL
値を 0 に設定することにしました。これで問題が解決しました。
@Version
列ができないのはなぜNULL
ですか? 他の誰かがこの問題に遭遇しましたか? ありがとう。