I am new to App Engine and wrote a sample application. If I create or update an object:
Entity record = new Entity(...);
... set properties
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
datastore.put(record);
and then redirect to the page where the new or updated object is displayed
resp.sendRedirect("MainPage.jsp");
where is the following code executed
DatastoreService datastore =
DatastoreServiceFactory.getDatastoreService();
Query query = new Query(...).addSort(..., Query.SortDirection.DESCENDING);
List<Entity> entities = datastore.prepare(query).asList(FetchOptions.Builder.withLimit(20));
The new entry is not in the list. The page refreshes (as shown in the timeline), but a new record or a change to an existing record is only displayed after a delay of up to several seconds when I refresh the page.
How can this be avoided? Is it possible that the DataStore is not suitable for such a thing?
I am using GAE's local Eclipse test environment with Windows XP 64.
source
share