views:

344

answers:

2

Is it possible (and does it make sense) to use the JDO Level 2 Cache for the Google App Engine Datastore?

First of all, why is there no documentation about this on Google's pages? Are there some problems with it? Do we need to set up limits to protect our memcache quota?

According to DataNucleus on Stackoverflow, you can set the following persistence properties:

 datanucleus.cache.level2.type=javax.cache
 datanucleus.cache.level2.cacheName={cache name}

Is that all? Can we choose any cache name?

Other sources on the Internet report using different settings.

Also, it seems we need to download the DataNucleus Cache support plugin. Which version would be appropriate? And do we just place it in WEB-INF/lib or does it need more setup to activate it?

+1  A: 

No known problems with anything to do with L2 caching and GAE/J. If people have problems then perhaps they ought to report them to Google. Set the cache name to what you wish. Anything put into memcache has to be Serializable, obviously, since that is what memcache does. Yes, you need the datanucleus-cache plugin (ver 1.x), and put it in the same place as any other DN jars. One day Google will update to use DN 2.x

DataNucleus
Why does the Entity class have to be Serializable? DataNucleus can already turn it into a low-level datastore.Entity, which is already Serializable.
Thilo
A: 

It seems to have problems instead: I tried (with JPA) and I got the error someone else already reported: http://code.google.com/p/datanucleus-appengine/issues/detail?id=163

luciano