On 11 Feb 2014 06:54:22 Michael Bayer <[email protected]> wrote:
> On Feb 11, 2014, at 3:44 AM, Wolfgang Schnerring <[email protected]> wrote:
> >        parent = session.query(Parent).first()
> >        self.assertEqual(1, len(parent.children))
> >        session.begin_nested()
> >        session.delete(parent.children[0])
> >        self.assertEqual(0, len(parent.children))
> > 
> > 
> > My point is, the last assertion fails, which I find both surprising and
> > inconvenient. ;) I'd be grateful for any insights you have about this.
> 
> I’m pretty sure I mentioned this was what it seemed like you were
> describing.  this is the “delete() on an object doesn’t remove it from all
> collections in which it is contained”.  it’s not related to savepoints and
> you can read about how to work with this behavior here:
> http://docs.sqlalchemy.org/en/rel_0_9/orm/session.html#session-deleting-from-collections

I know that flush does not trigger expiry. ;) I was wondering whether savepoints
qualified as being a stronger boundary than flush and thus might be worthy of
triggering expiry. But I guess that answers my question then: the current
behaviour *is* intentional, and if I want expire_all then I'll just have to
call it myself (which is fine, I guess).

Thanks for your patience,
Wolfgang


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to