Google App Engine - “java.lang.IllegalArgumentExce

2019-07-15 18:28发布

When calling DatastoreService.delete(keys) with 400 keys, I'm get this exception:

java.lang.IllegalArgumentException: datastore transaction or write too big.

I thought the limit on batch deletes was 500 so I am well under the limit. Am I missing something here?

Thanks, Keyur

1条回答
Viruses.
2楼-- · 2019-07-15 18:35

it looks like you're hitting the overall size limit for puts and deletes. you're right that batch puts and deletes have a limit of 500 entities, but there's also an overall size limit of roughly 10MB. i'm not sure if that's documented, but i'll check and have them add it if not.

so, try reducing the number of entities per delete call.

if you want to dig deeper, the size of a put or delete depends on many factors beyond the size of the individual entities, e.g. the size of the index rows that need to be updated. it's also generally based on the delta size of the update itself, not the size of the existing entities. this means it's not always intuitive or easy to calculate. these articles can help though:

http://code.google.com/appengine/articles/storage_breakdown.html
http://code.google.com/appengine/articles/life_of_write.html

查看更多
登录 后发表回答