On Thursday 02 October 2008 22:26:06 Michael Bayer wrote:
> On Oct 2, 2008, at 11:57 AM, [EMAIL PROTECTED] wrote:
> > hi
> > lets say, A points to B.
> > i do a query against A about which things link to some instance
> > of B. then,
> > 1) if i specify eagerload, i get many times same object-data
> > being piped from the server; ok but i dont want it
> > 2) if i dont specify eagerload (lazy), access to each A fires a
> > lazyload-query for the (same) B! Although the object is in memory
> > already. is this expected behaviour or? the relevant dbid is
> > already present, hence it can be checked against session-caches
> > etc?? what should i do here?
>
> if you load an A that wasnt previously present, its A.bs collection
> is empty.
> The individual B objects might be in the session but the 
> information that they are associated with your "A" is not present,
> unless we scanned through the Session and matched up foreign keys.
> This latter approach basically turns Session into its own
> relational engine which is why we dont even try to get into that. 
> So the lazy query for the"B"s proceeds, but we do reuse the B's
> already present in the session so there is far less overhead
> associated with fetching the rows.
>
> The approach taken by some ORMs Ive seen is to link the A.bs load
> to load the .bs for *all* As.  That seems pretty "dirty" to me
> since it means we have to keep track of Queries and such.

nah, it's a simple *toone singular reference, not a collection. 
can't something be done for it? hack something somewhere?

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to