db.get() -> entity -> Memcached -> entity -> dp.put() = bug

You can check this bug : 
http://code.google.com/p/googleappengine/issues/detail?id=631
But it not a good idea to use the memcache to store an entity then to
put this entity back to datastore.

Regards

On 4 avr, 16:15, Alkis Evlogimenos ('Αλκης Ευλογημένος)
<evlogime...@gmail.com> wrote:
> You need to do both. Memcache doesn't persist.
>
> 2009/4/4 秦锋 <feng.w....@gmail.com>
>
>
>
>
>
> > Thanks!
> > Does it means I have to put entity back to db or pickle it back to
> > memcache after changed something? Otherwise changes will be lost, I
> > guess.
>
> > On 4月4日, 下午9时31分, Tim Hoffman <zutes...@gmail.com> wrote:
> > > That is correct, an instance is being recreated from the data stored
> > > in memcache
>
> > > You will find the same value inside it though.
>
> > > What happens is the object is being pickled when you stick it into
> > > memcache, when you get it the object it
> > > is unpickled and essentially a new instance is created from the data
> > > stored.
>
> > > T
>
> > > On Apr 4, 7:14 pm, 秦锋 <feng.w....@gmail.com> wrote:
>
> > > > Following is my code in interactive console in local SDK admin web
> > > > page:
>
> > > > from google.appengine.api import memcache
> > > > from google.appengine.ext import db
>
> > > > r = db.Model()
> > > > memcache.set("Mytest", r)
>
> > > > i = 0
> > > > while i<10:
> > > >   print memcache.get("Mytest")
> > > >   i+=1
>
> > > > When I run it, I got different instances for the same key? Is it
> > > > wrong?
>
> > > > <google.appengine.ext.db.Model object at 0x024DCFF0>
> > > > <google.appengine.ext.db.Model object at 0x024DCE10>
> > > > <google.appengine.ext.db.Model object at 0x024DCDD0>
> > > > <google.appengine.ext.db.Model object at 0x024DCF50>
> > > > <google.appengine.ext.db.Model object at 0x024DCFF0>
> > > > <google.appengine.ext.db.Model object at 0x024DCE10>
> > > > <google.appengine.ext.db.Model object at 0x024DCDD0>
> > > > <google.appengine.ext.db.Model object at 0x024DCF50>
> > > > <google.appengine.ext.db.Model object at 0x024DCFF0>
> > > > <google.appengine.ext.db.Model object at 0x024DCE10>
>
> --
>
> Alkis
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to