Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detaching an object graph with a Map and an overridden hashcode() in the map key fails when the key is being detached #42

Open
andyjefferson opened this issue Apr 11, 2016 · 0 comments

Comments

@andyjefferson
Copy link
Member

Attached project demonstrates that PersistenceManager.detachCopy(Object) fails when the object graph has these properties:

  1. There is a loop
  2. The loop contains a Map key
  3. The Map key has hashcode() overridden

The reason detaching fails is that the instance added to the Map is still being detached (the fields are not set yet).

It is possible that this issue cannot be fixed due to the nature of the object graph, and the requirement of JDO to detach a copy.
DN_FailingDetach.zip

Detaching the same object graph at the end of a transaction (i.e. in-place) works perfectly. The settings for this are:
javax.jdo.option.DetachAllOnCommit=true
javax.jdo.option.RetainValues=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant