hi denis!
On Nov 22, 12:54 pm, Denis <
pr...@brushgroup.com> wrote:
> >You can now delete an entity directly using its key, without
> >instantiating/fetching the Model object
>
> Good. Will this be documented?
yup, it already is:
http://code.google.com/appengine/docs/datastore/functions.html#delete
> What happens is I pass non-existing key? On SDK the non-existing
> keys seem to be simply ignored. However the documentation suggest an
> exception will be raised (it also says an exception will be raised if
> the call span multiple entity groups!).
hmm, sorry if the documentation is unclear. you're right, deleting a
non-existent key is a noop. the docs say "An exception will always be
raised *if any error occurs*," and deleting a non-existent key isn't
considered an error.
also, deleting entities from multiple entity groups is allowed, and
even encouraged for efficiency. the "This may happen if the keys in
the call span multiple entity groups." sentence refers to the "even if
some of the entities actually were deleted" phrase, since deleting
entities across entity groups is not atomic.
> I'm also concerned about the performance of this deletion. I have a
...
> This code works, but works significantly slower (4 times) that the
> previous code with preliminary db.get(). It looks like deleting non-
> existing records take the same amount of time as deleting an existing
> record.
>
> Is this the SDK issue, or the production will also have such an
> issue?
as has been discussed before:
http://groups.google.com/group/google-appengine/browse_thread/thread/6a712cb3eddb152d
http://groups.google.com/group/google-appengine/browse_thread/thread/ba8d4ff7d825214/a5fc345c86a5abf2#a5fc345c86a5abf2
the SDK's performance is not representative of performance in
production. also, deleting non-existent keys in production will
usually be faster than deleting existing entities.