Hello,

I have noiticed a change of behaviour from 
rc3 to rc4 which I consider a bug.

I have wrote a junit test case that reveals the behaviour.  
Recall that Paper has a collection of Qualifiers,
which is mapped to an indirection table.
The collection-descriptor (in repository_junit.xml)
has auto-update="false".

  public void testStorePaper()
  {
    String now = new Date().toString();
    Paper paper = new Paper();
    paper.setAuthor("Jonny Myers");
    paper.setDate(now);
    Qualifier qual = new Topic();
    qual.setName("qual " + now);
    paper.setQualifiers(Arrays.asList(new Qualifier[] {qual}));
    broker.beginTransaction();
    broker.store(paper); // will appear in the database
    broker.store(qual);  // will appear in the database
    Identity paperId = new Identity(paper, broker);
    broker.commitTransaction();
        // now the indirection table CONTENT_QUALIFIER is still empty.

    broker.clearCache();

    broker.beginTransaction();
    Paper retPaper = (Paper)broker.getObjectByIdentity(paperId);
    System.out.println("retrieved: " + retPaper);
    List qualifiers = retPaper.getQualifiers();  // should contain the above
qual.
    System.out.println("ret qualifiers: " + qualifiers);
    assertEquals(1, qualifiers.size());  // fails, qualifiers is empty !
    broker.commitTransaction();
  }

I can work around that problem by setting auto-update="true", but I do not
want to do that (and I did not have to in 1.0.0 rc3), because I want to
exploit the performance gain I have when using
        PersistenceBroker.store(Object obj, ObjectModification modification)

rather than
        PersistenceBroker.store(Object obj),
and when I use auto-update="true", the object qual seems to get stored
automatically.

Can someone verify that this is a bug, or is it intended change of
behaviour?
In the latter case, does the combination of an indirection-table 
with auto-update="false" make sense at all?

BTW, I have not been able to reproduce the problem with the bi-directional
m-n-relation Project <-> Person.  

Regards,

Olli

-- 
  Oliver Matz
  ppi Media GmbH
  Deliusstra�e 10
  D-24114 Kiel
  phone +49 (0) 43 1-53 53-422
  fax           +49 (0) 43 1-53 53-2 22
  email mailto:[EMAIL PROTECTED]
  web   www.ppi.de


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to