问题
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