Is com.google.cloud.datastore.Datastore thread safe?

感情迁移 提交于 2020-03-04 08:57:07

问题


Is com.google.cloud.datastore.Datastore thread safe? More specifically, can one instance of Datastore be shared by multiple threads and can they all concurrently read from/write to the Cloud Datastore?

In other words, if I'm building a Web Application that accesses the Cloud Datastore, do I need a single instance of the Datastore object or a pool of Datastore objects (just like JDBC connections to an RDBMS)?

The API in question is http://googlecloudplatform.github.io/google-cloud-java/0.3.0/apidocs/.


回答1:


Yes, com.google.cloud.datastore.Datastore is thread-safe. We will make the docs clear about it.



来源:https://stackoverflow.com/questions/39402980/is-com-google-cloud-datastore-datastore-thread-safe

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