I've been playing with caching and looking through the mailing list and 
have a bit of confusion about whether or not you can actually cache DAL 
Selects with anything other than cache.ram due to issues with what 
can/cannot be pickled. When I use 

db(...).select(...,cache=(cache.disk, 300), cacheable=True)

Caching works just fine. But if I try it with cache.disk or cache.redis 
instead then I get errors which seem to be related to not being able to 
unpickle the cached select results. 

type 'exceptions.TypeError'> ("cannot create 'pyodbc.Row' instances", <type 
'pyodbc.Row'>, ....)


This, admittedly old, post seems to suggest that cache.redis should be 
pretty much drop-in for cache.ram but that's not my experience. 
https://groups.google.com/forum/?fromgroups#!searchin/web2py/caching$20model$20data/web2py/Tn4TiLPScII/jtMR1KtT4V8J


So does the ability to cache DAL Selects really only exist for cache.ram or 
am I missing something?


Brian

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to