Hi All
I have the following queries.
-- I inserted a new entity (but do not commit the transaction) into
the data store and then count the total number of entities in the data
store. There is no change in the count of entities from the previous
one. I think for that particular transaction it should be incremented
by one i.e. for a user that insert new record into table it should be
visible to that user even when transaction is not committed.
Sample code:
DatastoreService datastoreService =
DatastoreServiceFactory.getDatastoreService();
Transaction transaction = datastoreService.beginTransaction();
String employee = "Employee";
Query query = new Query(employee);
PreparedQuery preparedQuery = datastoreService.prepare(query);
int totalEntities = preparedQuery.countEntities();
response.getWriter().print("Total Row in DataSource before
insertion: " + totalEntities + "<br>");
Key key = KeyFactory.createKey(employee, 99656994);
Entity entity = new Entity(employee, key);
entity.setProperty("Name", "ABCD");
entity.setProperty("Village", "ASDF");
entity.setProperty("Designation", "Constable");
datastoreService.put(entity);
totalEntities = preparedQuery.countEntities();
response.getWriter().print("Total Row After Insertion : " +
totalEntities + "<br>");
preparedQuery = datastoreService.prepare(query);
response.getWriter().print("Total Row After Insertion after
reInitilization: " + totalEntities + "<br>");
transaction.commit();
-- Is it possible to delete an entity from table using low level api
without providing any Kay object(On the basis of filter other than
Key).
--I am not able to apply filter on Key of an entity.
--
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.