Datanucleus / JDO Level 2 Cache in Google App Engine

Is it possible (and does it make sense) to use the JDO level 2 cache for Google App Engine data storage?

First of all, why is there no documentation on this on Google pages? Are there any problems with this? Do I need to set limits to protect our memcache quota?

According to https://stackoverflow.com/a/167456/ ... you can set the following save properties:

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

It's all? Can I choose any cache name?

Other sources report online using various settings.

Also, it looks like we need to download the DataNucleus Cache support plugin . Which version would be appropriate? And we just put it in, WEB-INF/libor do you need additional settings to activate it?

+3
source share
3 answers

Before you can understand this, you must answer one question:

What version of DataNucleus are you using?

Everything on this post is connected with the old version of the plugin - v1. More recently, the Google Eclipse plugin supported the v2 DataNucleus plugin for AppEngine (which is mainly the channel between AppEngine and Core DataNucleus).

I would recommend updating the Datanucleus plugin for AppEngine to v2 - if you use Eclipse, easy - there is a user interface that allows you to choose v1 or v2. Just go to the properties of your project and find the App Engine settings and find the "Datanucleus JDO / JPA version".

, jdo-config.xml. , :

<property name="javax.jdo.PersistenceManagerFactoryClass" value="org.datanucleus.api.jdo.JDOPersistenceManagerFactory"/>

SO - v2 ( jdoconfig.xml):

<property name="datanucleus.cache.level2.type" value="jcache"/>
<property name="datanucleus.cache.level2.cacheName" value="NameItWhateverYouWant"/>

, PersistenceManager. !

+3

, L2 GAE/J. , , Google. , . , , memcache, Serializable, , memcache. , datanucleus-cache (ver 1.x) , DN. Google DN 2.x

+1

Source: https://habr.com/ru/post/1727452/


All Articles