On Jul 18, 2008, at 5:10 PM, Laurent Marchal wrote:
Hi !
I would like to do some DELETEs and INSERTs in one transaction, but
since DELETE is made after the INSERTs, it deletes the fresh
inserted values...
Yeah, weird. Could you post some sample code? Looking at your log, you
delete a dependent object from a relationship, and then readd a new
one? IMO the solution should be modifying the existing object instead
of doing delete/insert.
Is there a way to force cayenne to do DELETE before all others
operations when a commit occurs ?
The ordering algorithm is based on the changed objects graph
dependency analysis, to provide ordering consistent with FK
constraints. It does not address a scenario of object identity (PK)
disappearing and then reappearing again. There is probably a way to
customize it (although likely not an easy one), but I still feel like
this is not a valid case.
Andrus