On Feb 27, 2011, at 10:28 AM, Michael Bayer wrote: > > On Feb 27, 2011, at 3:28 AM, Chris Withers wrote: > >> On 27/02/2011 06:34, Michael Bayer wrote: >>> >>>> More interestingly, why does the use of sessionmaker versus the use of the >>>> standard Session class make a difference? >>> >>> the unit of work issues INSERTS in order for a single kind of entity. It >>> doesn't do that across all entities since the dependency order between >>> entities takes precedence. Such as here if you did in fact set up >>> Parent.children for one or more objects, the UOW sorts entities in order of >>> dependency. Its new in 0.6 that Parent/Child are not sorted by >>> dependency if they have no relationship to each other, but if you had a >>> second Parent/Child which did have a relationship in the flush, then all >>> the Parents would be first and all the Childs second (since common entities >>> are batched together unless there are inter-row dependencies). This all >>> has to do with the flush process being as fast, batched, and >>> memory-efficient as possible. >> >> Okay, but why does sessionmaker versus Session make a difference here? > > that is python set/dictionary behavior changing its ordering based on random > artifacts of the program. > >
final patch is at http://www.sqlalchemy.org/trac/attachment/ticket/2082/patch.txt . -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. 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.
