[google-appengine] Re: Memcache return different object for same key?

2009-04-05 Thread Sylvain
To see the issue, your entity must have a blob with a "big" size (500k) (so each update, the quota will grow fastly) Then you run this many times and check the quota. Check the pictures (inside the case) with 10 entity, my datastore grows up to 450 mb ;) Since few weeks, there is GAE batch that r

[google-appengine] Re: Memcache return different object for same key?

2009-04-04 Thread 秦锋
I did the same scenario but one more: db.get() -> entity -> Memcached -> entity -> dp.put() -> memcache.set ("Mykey", object()) I don't the difference with yours, and currently it seems OK for my quota. On 4月4日, 下午10时59分, Sylvain wrote: > db.get() -> entity -> Memcached -> entity -> dp.put() = b

[google-appengine] Re: Memcache return different object for same key?

2009-04-04 Thread Sylvain
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

[google-appengine] Re: Memcache return different object for same key?

2009-04-04 Thread 'Αλκης Ευλογημένος
You need to do both. Memcache doesn't persist. 2009/4/4 秦锋 > > 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 wrote: > > That is correct, an instance is

[google-appengine] Re: Memcache return different object for same key?

2009-04-04 Thread 秦锋
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 wrote: > That is correct, an instance is being recreated from the data stored > in memcache > > You will find the sa

[google-appengine] Re: Memcache return different object for same key?

2009-04-04 Thread Tim Hoffman
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 t

[google-appengine] Re: Memcache return different object for same key?

2009-04-04 Thread 'Αλκης Ευλογημένος
Also note that memcache pickles your entity automatically and unpickles it when you hit the cache. Pickling is dead slow in python so you are basically trading off CPU for DatastoreCPU time. You might want to look into custom pickling of your entities to make it more efficient to rebuild them when

[google-appengine] Re: Memcache return different object for same key?

2009-04-04 Thread David Symonds
On Sat, Apr 4, 2009 at 10:14 PM, 秦锋 wrote: > When I run it, I got different instances for the same key? Is it > wrong? Those would all be the same *value*; they are just at different memory addresses under the hood. Dave. --~--~-~--~~~---~--~~ You received thi