[sqlalchemy] Re: [REPEAT] ConcurrentModificationError without concurrent modification?

2008-01-23 Thread Michael Bayer
On Jan 23, 2008, at 8:01 AM, maxi wrote: I create an instance of Convenio [ convenio = Convenio() ] I do, convenio.prestaciones.delete(obj_instance) for delete a object from prestaciones list. Now, if I delete one object only, this work fine, but if I delete many (i.e: two obj) that error

[sqlalchemy] Re: [REPEAT] ConcurrentModificationError without concurrent modification?

2008-01-23 Thread maxi
the error is specifically about a many to many table where it expects to delete two rows but only one matches the criteria. If you are using more than one session, or removing rows from a many to many table using SQL statements, this error can occur. Sorry, I'am a little confuse abut it. (I

[sqlalchemy] Re: [REPEAT] ConcurrentModificationError without concurrent modification?

2008-01-23 Thread Michael Bayer
On Jan 23, 2008, at 2:15 PM, maxi wrote: Sorry, I'am a little confuse abut it. (I have only one session) I've the next table schema: convenio(conv_id) --- conv_pre(conv_pre_id, conv_id, pre_id) --- prestacion(pre_id)(convenio many to many with prestacion across conv_pre)

[sqlalchemy] Re: [REPEAT] ConcurrentModificationError without concurrent modification?

2008-01-23 Thread maxi
do you have anything else mapped to the conv_pre table ? it should *only* be mentioned in one place in your mapping setup. I only have something like this: class ConvPre(DBObject): pass mapper(ConvPre, conv_pre) --~--~-~--~~~---~--~~ You received this

[sqlalchemy] Re: [REPEAT] ConcurrentModificationError without concurrent modification?

2008-01-23 Thread Michael Bayer
On Jan 23, 2008, at 2:34 PM, maxi wrote: do you have anything else mapped to the conv_pre table ? it should *only* be mentioned in one place in your mapping setup. I only have something like this: class ConvPre(DBObject): pass mapper(ConvPre, conv_pre) OK, then you *cannot* use

[sqlalchemy] Re: [REPEAT] ConcurrentModificationError without concurrent modification?

2008-01-23 Thread maxi
OK, then you *cannot* use conv_pre as the secondary argument in another relation(). You need to use an association: If I remove ConvPre class and conv_pre mapper too. This problem is solved ? I don't need this class and mapper really. BTW, I will take a look to associationproxy, this look