org.apache.openjpa.persistence.ArgumentException: Attempt to assign id "0" to new instance "my.package.A-0" failed; there is already an object in the L1 cache with this id. You must delete this object (in a previous transaction or the current one) before reusing its id. This error can also occur when a horizontally or vertically mapped classes uses auto-increment application identity and does not use a hierarchy of application identity classes. FailedObject: my.package.A-0

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via openjpa-users by padamstx, 1 year ago
Attempt to assign id "0" to new instance "my.package.A-0" failed; there is already an object in the L1 cache with this id. You must delete this object (in a previous transaction or the current one) before reusing its id. This error can also occur
org.apache.openjpa.persistence.ArgumentException: Attempt to assign id "0" to new instance "my.package.A-0" failed; there is already an object in the L1 cache with this id. You must delete this object (in a previous transaction or the current one) before reusing its id. This error can also occur when a horizontally or vertically mapped classes uses auto-increment application identity and does not use a hierarchy of application identity classes. FailedObject: my.package.A-0
at org.apache.openjpa.kernel.ManagedCache.commitNew(ManagedCache.java:236)
at org.apache.openjpa.kernel.BrokerImpl.setStateManager(BrokerImpl.java:4145)
at org.apache.openjpa.kernel.StateManagerImpl.commit(StateManagerImpl.java:1164)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.