On Feb 14, 2011, at 11:54 AM, Kent wrote:

> Is there a mechanism for converting all lazy=False relationships for a
> particular Query into subqueryloads?
> 
> In general, I want these lazy=False, but for the case of FOR UPDATE
> and Oracle 8, the three aren't compatible.
> 
> (I suspect not since I couldn't find documentation for it.)
> 
> If not, suppose I have a subclassed "MyQuery".  Would finding and
> converting these via a query method be fairly straightforward?  (I
> suspect these may not be resolved until later)  Can you suggest a
> better approach?

really looking forward to the day you don't need to support oracle 8 anymore....

Normally I leave the eagerload stuff to query time as query options.   So 
there's not much challenge there, just use a function that returns 
subqueryload() instead of joinedload() based on the engine (are you using FOR 
UPDATE in so many places ?   doesn't all that locking kill your app in any case 
?).

The other would be to traverse all the relationships using 
mapper.iterate_properties(), find all the "lazy" flags and generate 
subqueryload() options for them.   That is straightforward but would require 
the thinking cap/read-the-source-cap to get all the way through it.


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