I’m trying to store a “complex” object in the datastore (JAVA) – it’s just a class that has a member like
ArrayList of type MyObject
where MyObject has datamembers(primitives – Strings and ints) of his own .
I’ve been having problems – the data isn’t stored\retrieved , so perhaps the way I read and write to Memcache is wrong –
I tried to use the regular put method
Memcache.put(Object Key,Object Value) with bad results – data isn’t stored.
Is there a problem with storing objects to Memcache like that ? I know that for example with the Datastore you have to use Blobs . Are Blobs necessary here ? Can someone give a short example to show how it needs be done ?
Memcache can handle any type of object, including complex arrays and child objects. All of the objects need to inherit Serializable. I’d guess that your problem is that your objects do not inherit Serializable.
Using Memcache is easy. The GAE docs have an example:
https://developers.google.com/appengine/docs/java/memcache/overview
More information about the Memcache service:
https://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/memcache/MemcacheService