Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Appengine Memcache not working for database entities #700

Open
niphlod opened this issue Jan 26, 2015 · 4 comments
Open

Google Appengine Memcache not working for database entities #700

niphlod opened this issue Jan 26, 2015 · 4 comments

Comments

@niphlod
Copy link
Member

niphlod commented Jan 26, 2015

From sebast..._at_cambeo.com on March 16, 2014 00:15:34

What steps will reproduce the problem? 1. use the following minimal use case for example in welcome/models/db.py:

from google.appengine.api import memcache
from google.appengine.ext import ndb

class TestModel(ndb.model):
pass

memcache.set("a", TestModel()) What is the expected output? What do you see instead? A database entity should be stored in memcache. This is very important for implementing own caching scenarios. Instead a pickling error is rendererd:
Can't pickle TestModel [...] >: import of module restricted failed What version of the product are you using? On what operating system? web2py 2.9.4, windows 8.1

Please provide any additional information below:
It appears that the web2py environment is not correctly injected into the pickle/unpickle calls of google appengine.

Original issue: http://code.google.com/p/web2py/issues/detail?id=1899

@niphlod
Copy link
Member Author

niphlod commented Jan 26, 2015

From massimo...._at_gmail.com on March 15, 2014 19:13:56

Does google say this is possible? I do not expect it to be possible.

@niphlod
Copy link
Member Author

niphlod commented Jan 26, 2015

From sebast..._at_cambeo.com on March 16, 2014 02:06:55

I understand yes: https://developers.google.com/appengine/articles/scaling/memcache?hl=de#entity_cache in paragraph "Caching frequently fetched entities"

Also: ndb.Model explicitly overwrites getstate and setstate to make it pickable

@niphlod
Copy link
Member Author

niphlod commented Jan 26, 2015

From massimo...._at_gmail.com on March 18, 2014 07:34:24

WIll look into it. Meanwhile be aware that you can cache DAL Rows objects. For pructical purposes that is the same and it is the web2py way.

@niphlod
Copy link
Member Author

niphlod commented Jan 26, 2015

From sebast..._at_cambeo.com on March 18, 2014 08:05:55

Thank you! Unfortunately we currently don't use the web2py DAL (at the time our project started, it didn't completely support GAE)

@gi0baro gi0baro removed the 1 star label Mar 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants