I\'m using the Google AppEngine, with Java. When I use some datastore features, I\'m getting an error message:
Object with id \"edvaltt.Teacher@64064b\" i
As illustrated in this ticket, shouldn't you close the pm (PersistenceManager
)?
} finally {
tx.commit();
pm.close();
}
DataNucleus,
Thank you for the pm.close();
tip.
I was making a query with one em
em = EMF.get().createEntityManager();
and making a commit with another one without closing the first one.
A persistent object can only be "managed" by one PersistenceManager. In DataNucleus this is backed internally by an "ObjectManager". The message says that you are trying to associate an object managed by one PM with a different PM. You can easily debug that by printing out the PM for each (persistent) object
JDOHelper.getPersistenceManager(obj);
Since you don't define where the message comes from, not much more can be said. The DataNucleus log entries would tell you way way more than that.
Closing the PM is always an essential thing to do (unless you want resource leaks)