On Feb 26, 2:29 pm, Jonathan Vanasco <[email protected]> wrote:
> i've been doing some aggressive caching and realized this issue.
>
> i'm wondering if this is just on my system for some odd reason...
>
> 1) i load a sqlalchemy object from model, and eagerload associated
> objects into it
> 2) i store that object into a cache ( the pylons caching facility,
> which is from myghty? )
> 3) if i pull that object out of the cache, the eagerloads are gone and
> sqlalchemy tries to lazyload
>
> has anyone else experienced this?
>
> i worked around this by saving the eagers separately.
>
> and i know its not good form to save sqlalchemy objects into a db...
> they're off a readonly handle and i didn't have time to write a
> serialize/deserialize function for some abstract class to handle
> caching database info yet.
Could you cache the rendered output instead of the objects? That might
sidestep the problem. I often cache the result of render_mako_def with
a descriptive cache_key (so it can be cleared when necessary, see the
Mako docs)... or get the relevant bit of template into a <%def> and
use the cache options on that. With memcached it's crazy fast.
HTH.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---