app engine data store retrieving the deleted entities

36 views
Skip to first unread message

Yashavanta S B

unread,
May 24, 2017, 8:16:46 AM5/24/17
to Google App Engine

I am trying to delete all the entities of a kind. After deleting i am trying to make query on the same kind. But the thing is, even after deleting all the entities the query is giving the results with some 'n' number of rows.

 I know it is the HRD issue where the indexes are not deleted yet. But i want to know from where the query is getting the data though we are deleted the actual data.

Consider the below code,


class CustomReportInfo {
 
String reportName;
 
 
// Setters and getters
}

Here i am trying delete the CustomReportInfo kind entities. In order delete the entities what i am doing is,


List<CustomReportInfo> customReportInfoList= quey(CustomReportInfo.class).list();
delete(customReportInfoList);


So, as you see i am deleting all the entities of CustomReportInfo. After that i am trying to make query on the same kind. Like,

List<CustomReportInfo> list = query(CustomReportInfo.class).list();


Still i am getting the 'n' number of rows after deleting. From where the query is getting the results even after the deleting the actual data?

Jun (Cloud Platform Support)

unread,
May 24, 2017, 4:04:12 PM5/24/17
to google-a...@googlegroups.com
Hi Yashavanta,

Due to the way Cloud Datastore works, querying entities just after a mass deletion is quite resource intensive, as all the entities are traversed but then discard due to the deletion. It seems like an eventual consistency problem here, so I would suggest that you try to make query on the same kind after some time to see if you can still see entities of that kind which has been deleted and let me know how it goes.

- Jun
Reply all
Reply to author
Forward
0 new messages