Hi Andy,

Regardless of the outcome, this is an issue that we should track. IIUC, either the tck test or the spec will have to change. It might be easier to track with a JIRA.

Thanks,

Craig

On Nov 19, 2010, at 6:54 AM, Andy Jefferson wrote:

Hi,

whilst this test passes with current DataNucleus, I was in the process of extending its support for managed relationships, and now get this test to fail
which provokes this question :-

pm.deletePersistent(proj1);
pm.flush();
deferredAssertTrue(!emp1.getProjects().contains(proj1),
   ASSERTION_FAILED + testMethod,
   "Postcondition is false; "
   + "other side of relationship not set on flush");

After the call to deletePersistent() and flush() the object "proj1" is in P_DELETED state. So when the call goes in to emp1.getProjects().contains(proj) this will interrogate the hashCode() method of Project. This is defined as
public int hashCode() {
   return (int)projid;
}

But when using datastore identity "projid" is *not* a primary-key field, and
so, as per section 5.5.6 of the spec
<spec>Read access to primary key fields is permitted. Any other access to persistent fields is not supported and might throw a JDOUserException.</spec>
So what does the implementation do ?


Comments ?

--
Andy
DataNucleus (http://www.datanucleus.org)

Craig L Russell
Architect, Oracle
http://db.apache.org/jdo
408 276-5638 mailto:[email protected]
P.S. A good JDO? O, Gasp!

Reply via email to