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

喜你入骨 提交于 2019-12-13 16:19:42

问题


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:


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



来源:https://stackoverflow.com/questions/2792413/google-app-engine-java-lang-illegalargumentexception-datastore-transaction-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!