On Dec 15, 2009, at 11:47 AM, Michael Bayer wrote:

>> 
> 
> the 53K calls to mapper._save_obj() indicate that your flush plan is
> creating an enormous dependency tree.   Or, much less likely, you're using
> the "batch=False" flag on mapper, which is highly not recommended.   For a
> simple flush plan, such as a list of objects A each of which contain a
> one-to-many collection of objects B, _save_obj() would be called about
> four times.    A flush plan like the one you have could for example occur
> in some self-referential scenarios, if you have a deep tree of recursive
> relationships for example.   A test script illustrating mappings and
> sample objects which produce a huge flush like this would be helpful, as
> there may be either an improvement to your mapping, or within the unit of
> work code which could optimize whatever is occurring here.


just in case you're not motivated to share mappings here, I would note that an 
incorrect placement of a flag like "remote_side" on a relation() may be causing 
this.  I've never seen a flush plan that results in _save_obj() being called 
more than a few dozen times, in fact.    So we really need to see how you're 
getting that result, since if its a configurational error I'll add a check such 
that the incorrect configuration becomes impossible.




> 
> 
> 
> 
> 
> 
> 
> 
>> 
>> --
>> 
>> 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.
> 
> 

--

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.


Reply via email to