I get an error object already exists
when calling em.persist(serviceInstance)
method. Object has several OneToMany(unidirectional)
child object links, and one of the ServiceInstance -> ServiceInstanceProperty
child object has this error.
I put SQL=TRACE
logging but this error happens before sql formula is sent to a jdbc driver. Tried to sysout print prop.hashCode()
but no match to a ServiceInstanceProperty@4f70aab2
value I can think of.
Is there a way to get more information about this object, hashCode()+key_values+values anything able to match to a property instance? Can I ask OpenJPA to give me @4f70aab2
value of the property instance?
Caused by: <openjpa-3.2.2-re5933d6 nonfatal store error> org.apache.openjpa.persistence.EntityExistsException:
An object of type "my.db.ServiceInstanceProperty" with oid "my.db.ServiceInstanceProperty-my.db.BeanProperty$PK@b0709ec6"
already exists in this context; another cannot be persisted.
FailedObject: my.db.ServiceInstanceProperty@4f70aab2
at org.apache.openjpa.kernel.BrokerImpl.checkForDuplicateId(BrokerImpl.java:5333)
https://github.com/apache/openjpa/blob/b3d1ef8671751d47617eaf4ac259b43eae45e53b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java#L5326