i have upgraded to appengine sdk 1.8.0, appengine DN 2.1.2 and DN 3.1.3. all working nice.
in the appengine docs it states
Level2 Caching is enabled by default.
https://developers.google.com/appengine/docs/java/datastore/jpa/overview-dn2
I assume that the JPA L2 cache is backed by memcache.
but when i update the entity by Datastore viewer the JPA code is still returning the stale version of data.
my JPA entity is below
@Entity
@Cacheable(true)
@NamedQueries({ ....snip
public class GeoLocationUser implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key key;
private double latitude;
the query is a named query
@NamedQuery(name = GeoLocationUser.FIND_BY_USER_KEY,
query = "Select p from GeoLocationUser p where p.parentKey = :userKey"),
use case
Entity is created using JPA code.
I update a field called 'latitude' in the entity using datastore viewer from '0.0' to '1.0'.
i run a restful query on my application using JPA.
the entity returned has 'latitude' = '0.0'
i then flush memcache
i run a restful query on my application using JPA.
the entity returned has 'latitude' = '0.0'
the JPA code is picking up the stale data and i dont know why.
Q1.any explanation on the observed behaviour i most appreciated.
Q2. is the appengine DN 2.1.2 backed by memcache?
thanks -lp