Can you see if it's a specific entity that causes this issue? If so, it
should have been resolved. We have a thread about this topic here:

http://groups.google.com/group/google-appengine/browse_thread/thread/32a491e702cb79bd/e83633cc35aceb76#e83633cc35aceb76

On Thu, Apr 29, 2010 at 5:03 AM, bogyom <[email protected]> wrote:

> Hi,
>
> I'm using the low level data-store api to delete entities. Here is my
> code:
>
> private int deleteEntities(String kind, String from, String to, int
> limit) {
>        Query q = createKeyPrefixQuery(kind, from, to);
>        q.setKeysOnly();
>
>        ArrayList<Key> keys = new ArrayList<Key>(limit);
>        Iterable<Entity> entities = datastore.prepare(q).asIterable(
>                FetchOptions.Builder.withLimit(limit));
>        for (Entity e : entities) {
>            keys.add(e.getKey());
>        }
>
>        datastore.delete(keys);
>        return keys.size();
>    }
>
> I'm using a limit of 100 and delete around 50000 entities in a row
> (100 entity chunks)
>
> It works fine 99% of the time but sometimes i'm getting this:
>
> com.google.appengine.api.datastore.DatastoreFailureException: internal
> error.
>        at
>
> com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
> 51)
>        at
>
> com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:
> 67)
>        at com.google.appengine.api.datastore.DatastoreServiceImpl
> $3.run(DatastoreServiceImpl.java:250)
>        at
>
> com.google.appengine.api.datastore.TransactionRunner.runInTransaction(TransactionRunner.java:
> 30)
>        at
>
> com.google.appengine.api.datastore.DatastoreServiceImpl.delete(DatastoreServiceImpl.java:
> 236)
>        at
>
> com.google.appengine.api.datastore.DatastoreServiceImpl.delete(DatastoreServiceImpl.java:
> 222)
>        at
>
> com.scarabresearch.recserver.dao.gae.GAEPersistence.deleteEntities(GAEPersistence.java:
> 310)
>
> I wait and retry a couple of times which helps but sometimes after a
> couple of minutes of retrying i still could not delete the entities.
>
> How can i make this more reliable?
> Thanks
> Gyorgy
>
> --
> 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]<google-appengine-java%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>


-- 
Ikai Lan
Developer Relations, Google App Engine
Twitter: http://twitter.com/ikai
Delicious: http://delicious.com/ikailan

----------------
Google App Engine links:
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/appengine

-- 
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.

Reply via email to