Marco De Felice wrote: > Hi all > This unusual problem appeared today. > I have a mapper extension that gets called twice if I do a query on a > relate_table while updating properties of a mapped object. > I do something like this: > > myObj = myMappedObject > > session.begin() > myObj.id = something > myObj.second = something > myObj.value = session.query(myRelatedObject).get(1) > myObj.third = xxxx > > at this point my mapper extensions gets called twice, so I discovered > that two consequent updates got fired by sqlalchemy, but only if I use > the same session, if I use a second session to query the related object > all goes well. > > session.flush() > session.commit() > > Is there a simple answer for this?
autoflush ? > > > > > > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalch...@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.