On Fri, Jan 9, 2015 at 2:42 PM, Jon Nelson <[email protected]> wrote:
> On Fri, Jan 9, 2015 at 2:21 PM, Michael Bayer <[email protected]>
> wrote:
>>
>>
>> Jon Nelson <[email protected]> wrote:
>>
>>>
>>>> so you could use either merge() or merge_result() but to avoid any SQL set
>>>> load=False.
>>>
>>> When I tried with load=False, I got an error. I am using 0.9.8.
>>
>> care to be more specific
>
>
> Absolutely.
>
> It took me a bit to grab a bite to eat and whip up a quick test example.
> I hope the following is more useful!
I Know what it is!
> dbsess.query(Foo).filter(Foo.c1.in_(keys)).all()
^^^
If I throw the result out, the session's *weak-reference* on the
instances may allow them to be garbage collected.
Hah!
If I change the above line to:
zz = dbsess.query(Foo).filter(Foo.c1.in_(keys)).all()
and change nothing else, then both the 'merge' and 'merge_result'
approaches work great!
--
Jon
Software Blacksmith
--
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/d/optout.