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?
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
--
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
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.