I'm saving an object with Objectify like this:
Thing th = new Thing();
th.identifier = thingId;
th.name = thingName;
th.json = thingData;
ofy().save().entity(thing);
pResponse.setStatus(200);
pResponse.getWriter().println("OK");
I verify using the GAE datastore browser that the value has been updated in the database. I'm running locally. Then I load all things like this:
Map<String, List<Thing>> responseJsonMap = new HashMap<String, List<Thing>>();
List<Thing> things = ofy().load().type(Thing.class).list();
responseJsonMap.put("things", things);
pResponse.setContentType("application/json");
try {
GSON.toJson(responseJsonMap, pResponse.getWriter());
} ...
What I get back is the data that existed before the save. I have tried turning caching off on the entity and calling ofy().clear() but neither work. If I restart my server or wait long enough, the saved data comes through. I have also tried adding .now() after the save, but it's not necessary since I can verify in the datastore that the action has completed. I really would like to be able to load the data I just saved. What am I doing wrong?