On May 7, 2010, at 10:44 AM, Ergo wrote:

> now unless i call User.by_id(id, invalidate=True), All my queries
> contain wrong cached data.
> even if i do directly in controller of my app something like:
> 
> c.users = meta.Session.query(User).order_by(User.username).limit(30)
> the returned rows will have different values than in database.

if you already loaded those User objects from a stale cache within the current 
transaction,  then they'd still show that old data.    If you want fresh from 
the current transaction you should expire those objects first.

otherwise sounds like your cache is stale.   from your example 
"invalidate=True" won't return any data whatsoever, so I'm assuming a regular 
call returns the correct result subsequent to an invalidate, so this isn't 
really indicating anything unusual.

if you have strange things going on I'd suggest you use pdb to ensure data is 
as expected at each step.




-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@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