views:

428

answers:

0

I get the following error when attempting to persist an object:

java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST

Is there any simple way to tell which relationship has the problem object?

It is possible that the persisted object has many relationships and a trial and error or find by elimination works, but I would like to know if there is a simpler quicker way to identify the problem relationship object.

Update: I encounter this problem periodically, and I have always been able to find the source of the problem, or have been able to reorder the operations in order to solve the problem, but my issue is the amount of time that it takes to find the offending object.

My solutions have always been found by trial and error. I sometimes find the solution in minutes, but sometimes it takes hours. My question is: is there an easier way to find which of possibly many relationships is causing the problem. The exception only claims that a "new object" was found through a "relationship", this does not help me to find which object or which relationship. Is there a log or a way to tell the system to provide a more specific error?