当我想在数据库中插入行时,我遇到了一个 JPA 异常问题,我遇到了这个异常:
javax.persistence.RollbackException: Exception [EclipseLink-7124] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
Exception Description: An unsuccessful writeChanges() has been called on this UnitOfWork. Given the danger that partial changes have been written to the datastore but not rolled back (if inside external transaction), the only supported operations now are release, global transaction rollback, any non-object level query or SQLCall execution. The operation commit was attempted.
at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:102)
at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
at database.TarpineManager.commitTransaction(TarpineManager.java:23)
at gijos.InsertToDB.insertLink(InsertToDB.java:57)
at gijos.LygiagretusIrasymas.run(LygiagretusIrasymas.java:26)
Caused by: Exception [EclipseLink-7124] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
Exception Description: An unsuccessful writeChanges() has been called on this UnitOfWork. Given the danger that partial changes have been written to the datastore but not rolled back (if inside external transaction), the only supported operations now are release, global transaction rollback, any non-object level query or SQLCall execution. The operation commit was attempted.
at org.eclipse.persistence.exceptions.ValidationException.unitOfWorkAfterWriteChangesFailed(ValidationException.java:1802)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1119)
at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
... 4 more