[Twisted-web] Twisted and SQLAlchemy Cache Problem

Sébastien LELONG sebastien.lelong at dexia-securities.fr
Wed Jun 13 11:22:45 EDT 2007

> only seems to execute one select statement. The other result seems to
> be taken from the cache.

AFAIK, SQLAlchemy does perform the select statements, but, the second time,  
does not populate your mapped object since it's already present in the 
identity_map cache. You can see these by turning SA's engine.echo = True

> Yes, that seems to be the problem. For this my tiny problem, I can get
> away by simply not using activemapper, though.

Have you tried myobject.refresh(), before the second time ? This will force SA 
to repopulate your instance

Also, depending on your application behavior, you might want to consider a 
request to your server <=> a session in SA (that's usually what used for web 
apps). This means each time you end a request, you would have to 
session.clear(), preventing any caching.

Hope that helps.


Sébastien LELONG

More information about the Twisted-web mailing list