Re: [sqlalchemy] SQLAlchemy ORM Object caching with relationships and invalidation

2012-09-29 Thread mikepk
Thanks Michael, I really appreciate the response. This broke something of a mental log-jam I was having. The original use I had in mind for this was for my web framework. I was using it to tag Session objects for caching and then attach user specific data and frequently accessed data to the

Re: [sqlalchemy] SQLAlchemy ORM Object caching with relationships and invalidation

2012-09-28 Thread Michael Bayer
On Sep 27, 2012, at 1:28 AM, Michael Kowalchik wrote: Lets say I have object A that's in the cache and it has a relationship, A.B that was stored along with it in the cache. If I retrieve A from the cache I can get A.B and I get the cached copy of B. If B is modified, however, then my

[sqlalchemy] SQLAlchemy ORM Object caching with relationships and invalidation

2012-09-26 Thread Michael Kowalchik
Unlike most of the SQLAlchemy caching examples, I'm not using query-level caching but rather caching at the instance / object level. I'm using the ORM and I have a SQLAlchemy object that I load and occasionally store in a second level cache. I have a custom 'get' loading function that checks