开发者

Google App Engine - "java.lang.IllegalArgumentException: datastore transaction or write too big."

When calling DatastoreService.delete(keys) with 400 keys, I'm开发者_如何学JAVA 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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜