Re: [sqlalchemy] is it possible to make load_only local to an object only and/or avoid the identity map and/or not available via `get`?

2018-05-13 Thread Jonathan Vanasco
On Sunday, May 13, 2018 at 10:27:16 PM UTC-4, Mike Bayer wrote: > > > that's not true, you can use the same database connection on a second > Session. Just say s2 = Session(bind=s1.connection()). > Thanks, mike. I didn't know this was doable - it seems like the right approach. The

Re: [sqlalchemy] is it possible to make load_only local to an object only and/or avoid the identity map and/or not available via `get`?

2018-05-13 Thread Mike Bayer
On Sun, May 13, 2018 at 3:21 PM, Jonathan Vanasco wrote: > A better way of conveying my problem might be: `get()` returns any object > which is in the identity map; I am having issues after the identity map is > now populated with some objects which are 'partials' that were

Re: [sqlalchemy] is it possible to make load_only local to an object only and/or avoid the identity map and/or not available via `get`?

2018-05-13 Thread Jonathan Vanasco
A better way of conveying my problem might be: `get()` returns any object which is in the identity map; I am having issues after the identity map is now populated with some objects which are 'partials' that were created via 'load_only' parameters. The benefits of using `get` to minimize a

Re: [sqlalchemy] is it possible to make load_only local to an object only and/or avoid the identity map and/or not available via `get`?

2018-05-13 Thread Mike Bayer
On Sat, May 12, 2018 at 4:28 PM, Jonathan Vanasco wrote: > > > On Saturday, May 12, 2018 at 9:49:34 AM UTC-4, Mike Bayer wrote: >> >> >> The former would be a bug. The latter, I'm not sure what you would expect >> it to do. Do you want the unloaded attributes to raise

Re: [sqlalchemy] is it possible to make load_only local to an object only and/or avoid the identity map and/or not available via `get`?

2018-05-12 Thread Jonathan Vanasco
On Saturday, May 12, 2018 at 9:49:34 AM UTC-4, Mike Bayer wrote: > > > The former would be a bug. The latter, I'm not sure what you would expect > it to do. Do you want the unloaded attributes to raise attribute error? > Or did you want the get() to fully refresh what was not loaded (that

Re: [sqlalchemy] is it possible to make load_only local to an object only and/or avoid the identity map and/or not available via `get`?

2018-05-12 Thread Mike Bayer
On Fri, May 11, 2018, 5:13 PM Jonathan Vanasco wrote: > I tracked down a pattern that has been causing some bottleneck issues in > an app. I'm hoping there may be a way to handle this, but for once I don't > expect there to be! > > The problem arises when I fetch a

[sqlalchemy] is it possible to make load_only local to an object only and/or avoid the identity map and/or not available via `get`?

2018-05-11 Thread Jonathan Vanasco
I tracked down a pattern that has been causing some bottleneck issues in an app. I'm hoping there may be a way to handle this, but for once I don't expect there to be! The problem arises when I fetch a specific "light" query with joined objects (however toplevel objects have the same issue).