Closed amiyalenka82 closed 3 years ago
Thanks for the report.
Which part of the Datastore API are you using? (i.e. are you using DatastoreTemplate
or the spring data repository classes?)
@meltsufin -- Should we revisit the discussion about ThreadLocal
context mentioned in #2204?
I am using Autoconfiguration, it creates the DatastoreTemplate. I am referring the below documentation to implement multitenancy,
public interface DatastoreNamespaceProvider extends Supplier
DatastoreNamespaceProvider extends the Supplier with String type, it is only overriding the namespace provided in application.properties file. This helps if we are doing CRUD operations against only one namespace at a given time.
I see. It looks like another user posted a solution that may work; if you implement the DatastoreNamespaceProvider
accessing state from ThreadLocal
then you can have it set the namespace dynamically: https://github.com/spring-cloud/spring-cloud-gcp/issues/2204#issuecomment-780524911
We can improve the API on our end so you don't have to specify a default and document this better.
I copied over your issue to our 2.0.0
repo here: https://github.com/GoogleCloudPlatform/spring-cloud-gcp/issues/317
We're planning for all of our new feature requests and updates to go into the 2.0.0
version.
In the earlier issues: https://github.com/spring-cloud/spring-cloud-gcp/issues/1289, https://github.com/spring-cloud/spring-cloud-gcp/issues/2204
It says multitenancy is fixed but I still see issues,
DatastoreNamespaceProvider only overrides the namespace provided in application.properties file. So, at a particular time, you have only one namespace available. How can I actually work on multiple namespaces? I can have multiple threads running in the same application and using different namespaces simultaneously.