cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Razumovsky <razumovsky.and...@gmail.com>
Subject Circle references
Date Wed, 15 Apr 2009 12:37:27 GMT
Hi,

I've got three entities, A, B, and C and three to-one relationships (A->B,
B->C, C->A). When I fire code like that:

A a = context.newObject(A.class);
B b = context.newObject(B.class);

a.setToB(b);
context.commitChanges();

I *sometimes* get SQL exception at commit, saying that object in B does not
exist when inserting A, i.e. Cayenne is insering records in wrong order.
Seems that it just can't define order of commits because of circle
references. Can I somehow help Cayenne solve this puzzle? (I think I can
even sacrifice some of reverse (to-many) relationships.
And what's the algorithm of sorting entities before commit?

Thanks,
Andrey

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message