On Dec 27, 2011, at 1:51 PM, Kent wrote:

> In http://www.sqlalchemy.org/trac/changeset/7025%3A0a6576abea5b#file1
> you added a warning that I'm hitting now.
> 
> 'when "save-update" cascade is disabled, or the target object is
> otherwise not
> present in the session, and collection/scalar changes have taken
> place. A warning
> is emitted describing the type of operation, the target reference, and
> the relationship
> description, stating that the operation will not take place.'
> 
> Do you think it is appropriate to skip the warning if the object isn't
> in the session *and* the "save-update" cascade is disabled?
> 
> With *both* conditions present, it would seem the user has arranged
> them as such intentionally (at least in my case).

It basically means it's doing a flush and outright ignoring an object that 
you've assigned to a collection or scalar.   I don't know that the UOW should 
ever break it's behavioral contract that badly and not at least say something.

>  Either that or they
> messed up twice (I suppose that is the more conservative approach,
> huh?)

The save-update cascade is often disabled so that someone can have control over 
when an object gets placed into the session.    In that case they want to still 
be adding objects in manually, so actually when save-update is turned off is 
when the warning does actually become very important.

> 
> Possibly consider a different warning for that case?  I like the idea
> of raising this warning, but only if one or the other conditions
> exist, but not both.

so you're not only working with detached objects, getting them to load things 
despite their being detached, which I've maintained is not how the ORM was 
intended to be used, now you're also trying to mix and match them with 
collections that are being flushed ?    Can I get a reminder what the use case 
here is again ?   I hope this isn't all just for performance....


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

Reply via email to