问题描述
com.google.cloud.datastore.Datastore
线程安全吗?更具体地说, Datastore
的一个实例可以由多个线程共享,并且它们都可以同时从Cloud Datastore读取/写入吗?
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?
换句话说,如果我正在构建访问Cloud Datastore的Web应用程序,我是否需要 Datastore
对象的单个实例或 Datastore
的池对象(就像到RDBMS的JDBC连接一样)?
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)?
有问题的API是 http://googlecloudplatform.github.io/google-cloud-java/0.3.0/apidocs/.
推荐答案
是的, com.google.cloud.datastore.Datastore
是线程安全的.我们将使文档清晰明了.
Yes, com.google.cloud.datastore.Datastore
is thread-safe. We will make the docs clear about it.
这篇关于com.google.cloud.datastore.Datastore线程安全吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!