javax.persistence.RollbackException

java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: biz.solidc.study.jpa.jpastudy.oneWay.oneToOne.Product@49bcb0d6[id=<null>,name=製品-A].

Samebug tips0

There are no available Samebug tips.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web27

Stack trace

  • javax.persistence.RollbackException: java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: biz.solidc.study.jpa.jpastudy.oneWay.oneToOne.Product@49bcb0d6[id=<null>,name=製品-A]. 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 biz.solidc.study.jpa.jpastudy.oneWay.oneToOne.OneToOneTest.testInsert(OneToOneTest.java:42) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Unknown visitor
Unknown visitor1 times, last one,
Unknown visitor
Unknown visitor1 times, last one,
Unknown visitor
Unknown visitor1 times, last one,
Unknown visitor
Unknown visitor1 times, last one,
Unknown visitor
Unknown visitor1 times, last one,
2 more bugmates