google app engine - appengine DataNucleus plugin 2.1.2 cache behaviour -
i have upgraded appengine sdk 1.8.0, appengine dn 2.1.2 , dn 3.1.3. working nice.
in appengine docs states
level2 caching enabled default.
https://developers.google.com/appengine/docs/java/datastore/jpa/overview-dn2
i assume jpa l2 cache backed memcache.
but when update entity datastore viewer jpa code still returning stale version of data.
my jpa entity below
@entity @cacheable(true) @namedqueries({ ....snip public class geolocationuser implements serializable { @id @generatedvalue(strategy = generationtype.identity) private key key; private double latitude;
the query named query
@namedquery(name = geolocationuser.find_by_user_key, query = "select p geolocationuser p p.parentkey = :userkey"),
use case
entity created using jpa code.
i update field called 'latitude' in entity using datastore viewer '0.0' '1.0'.
i run restful query on application using jpa.
the entity returned has 'latitude' = '0.0'
i flush memcache
i run restful query on application using jpa.
the entity returned has 'latitude' = '0.0'
the jpa code picking stale data , dont know why.
q1.any explanation on observed behaviour appreciated.
q2. appengine dn 2.1.2 backed memcache?
thanks -lp
from logs seems indeed level 2 cache 'soft' default. no idea sure 'soft'means.
however seems level 1 cache causing behaviour above.
when stopped running instance next invocation caused new instance new level 1 cache. new value returned.
very impressive caching guys. done.
-lp
Comments
Post a Comment