The following code:
===
def ec=ERXEC.newEditingContext(),ec2=ERXEC.newEditingContext()
ec.lock(); ec2.lock() // pbbly superfluous, but you said this prevents lots of hidden surprises :)
def eo=EOUtilities.objectWithPrimaryKeyValue(ec,'DBAuction',1000004)
def records=eo.importedRecords()
def r1=records[0],r2=records[1]
r1.removeObjectFromBothSidesOfRelationshipWithKey(eo,'auction')
ec.saveChanges()
def eo2=eo.localInstanceIn(ec2),r22=r2.localInstanceIn(ec2)
//eo2.changesFromCommittedSnapshot() // WHAT THE?!?
r22.removeObjectFromBothSidesOfRelationshipWithKey(eo2,'auction')
ec2.saveChanges()
===
works properly, i.e., it DELETEs twice. As soon as I remove the comment-out at the WHAT THE line, i.e., as soon as "eo2.changesFromCommittedSnapshot()" gets called, I get DELETE/UPDATE (to null). Comment the line out again, two DELETEs are back.
This gets curiouser and curiouser.
Do you have any idea what the b. H. happens there? Or at least, what would you recommend I should try now, so that the culprit is found?
Thanks and all the best,
OC
[*] What mislead me were my overridden toString's, in which I use changesFromCommittedSnapshot to print out the edited state.