我相信它應該非常快(30-50毫秒),在你的情況下,如果你試圖在存儲數據存儲之後立即從數據存儲獲取實體,它應該不成問題。
您可以使用log4j並嘗試輸出持續時間的時間以瞭解需要多長時間。
實施例,
INFO:時間持續數據存儲區:38毫秒
# A default log4j configuration for log4j users.
#
# To use this configuration, deploy it into your application's WEB-INF/classes
# directory. You are also encouraged to edit it as you like.
# Root logger option
log4j.rootLogger=INFO
# Configure the console as our one appender
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n
# tighten logging on the DataNucleus Categories
log4j.category.DataNucleus.JDO=WARN, A1
log4j.category.DataNucleus.Persistence=WARN, A1
log4j.category.DataNucleus.Cache=WARN, A1
log4j.category.DataNucleus.MetaData=WARN, A1
log4j.category.DataNucleus.General=WARN, A1
log4j.category.DataNucleus.Utility=WARN, A1
log4j.category.DataNucleus.Transaction=WARN, A1
log4j.category.DataNucleus.Datastore=WARN, A1
log4j.category.DataNucleus.ClassLoading=WARN, A1
log4j.category.DataNucleus.Plugin=WARN, A1
log4j.category.DataNucleus.ValueGeneration=WARN, A1
log4j.category.DataNucleus.Enhancer=WARN, A1
log4j.category.DataNucleus.SchemaTool=WARN, A1
之後立即獲得Id是一個問題,但我不確定這個答案是什麼,但是這裏的信息支持這個答案,即這個Key可以立即使用 - 至少是使用DatastoreService.put()。我同意,因爲需要構建Key https://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/DatastoreService#,因此應該立即推出Id把%28com.google.appengine.api.datastore.Entity 29% – user1445967