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

  1. entity created using jpa code.

  2. i update field called 'latitude' in entity using datastore viewer '0.0' '1.0'.

  3. i run restful query on application using jpa.

  4. the entity returned has 'latitude' = '0.0'

  5. i flush memcache

  6. i run restful query on application using jpa.

  7. 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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -