Hello,

deleting 500 should not take a lot of time. Did you try the
deletePersistentAll method?
                        Query q = pm.newQuery(persistentClass);
                        q.deletePersistentAll();

otherwise what I do is using the task queue. I delete 1000 entities
and then put a task in the queue to delete another 1000. In that case
you can not use the deletePersistentAll. You need to query by object
type and limit:

                        Query q = pm.newQuery(query);
                        q.setRange(0, size);

                        try {
                                resultList = (List<T>) q.execute();
                                resultSize = resultList.size();
                                for (T t : resultList) {
                                        pm.deletePersistent(t);
                                }
                                return resultSize;
                        } finally {
                                q.closeAll();
                        }

since I return the size I see how much records where affected. If it
is less than 1000 I know that I can stop doing the queuing.
This is a bit difficult to set up but works fine. I believe there is
not better way to do that but I am happy about any other suggestions.

Cheers,
Toby





On Mar 12, 7:08 am, 杨浩 <[email protected]> wrote:
> in the admin console:clike the next 20 entity,then change the brower's
> location.href set *size=200* and *offset=0*, enter^ ^
> The offset's max is *1000*
> Good luck!
>
> 2010/3/12 Spines <[email protected]>
>
>
>
> > I'm only able to delete 20 entities at a time,  I have over 500
> > entities of a certain kind. Is there a  way I can delete them all from
> > the admin console?

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