Sorry, I should probably have mentioned that C isn't the only object
that maps A, so a cascade doesn't work.

2008/11/27  <[EMAIL PROTECTED]>:
>
> i'm not expert on these, but i think u need something like
> cascade='all' on your relation, _instead_ of the mapperExt. check the
> docs about possible settings. the mapperExt fires too late and the
> session flush-plan gets surprised.
>
> On Thursday 27 November 2008 08:15:04 David Harrison wrote:
>> Hey all,
>>
>> I've got a situation where I have 2 object A and B, and a third
>> object C that has a foreign key reference to both A and B.  I can
>> have many C's that map to the same A.
>>
>> Now I've implemented a MapperExtension for C that has an
>> after_delete function, and that function checks to see if the A
>> that the deleted C was mapped to has any other mappings, and if
>> there are no other mappings left, deletes the A.
>>
>> Now this works fine if I'm just deleting C's directly, however as
>> soon as this happens during a cascade delete from some other object
>> D that happens to have a mapping to C I get the below error - I'm
>> assuming this is because sqlalchemy has a test condition that
>> doesn't see my mapper coming, and freaks out when extra rows get
>> nuked.
>>
>> "ConcurrentModificationError: Deleted rowcount 0 does not match
>> number of objects deleted 4"
>>
>> Help ?
>>
>> Cheers
>> Dave
>>
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to