In multitenant application instance is created once the namespace is set when other user tries to access the app through different instance actions are performed excepts from entries having common name.
在多租户应用程序实例中,一旦设置了命名空间,当其他用户尝试通过不同的实例操作访问应用程序时,将执行实例,除了具有通用名称的条目。
Example: if i log into app with namespace country1 and then try to login with country2 user from country2 and country 1 who have same key say john when tries to login its credentials are checked with as of country1 hence it gives wrong password. If tried to login by user which is only in country2 login is success but now if comman key are searched they give result that of country1
示例:如果我使用命名空间country1登录app,然后尝试使用country2和country1的country2用户登录,那么当尝试登录其凭据时,具有相同密钥的john表示john,因为它提供了错误的密码。如果尝试用户登录只在country2登录成功但现在如果搜索到comman密钥他们给出country1的结果
Overall once one namespace is set search command give result in favor of namespace which was set earlier.Instead of namespace who should give results independent of each other.
总的来说,一旦设置了一个命名空间,搜索命令就会产生有利于之前设置的命名空间的结果。而不是命名空间谁应该给出彼此独立的结果。
thanks in advance.any help is appreciated.
在此先感谢。非常感谢。
2 个解决方案
#1
0
Can you provide more details or perhaps share some code here? Where are you setting the namespace?
你能提供更多细节或者在这里分享一些代码吗?你在哪里设置命名空间?
In general, you need to set the namespace as soon as you get a request. If you are using Java, for example, you should do that using a Filter. After setting the namespace, all requests operations are going to use this namespace seamlessly. I don't understand why would you need to change that, but if you really need to do that, I don't see a problem... although you should be really careful because this approach may lead to a very confusing and buggy situation.
通常,您需要在收到请求后立即设置命名空间。例如,如果您使用的是Java,则应使用过滤器。设置命名空间后,所有请求操作都将无缝地使用此命名空间。我不明白为什么你需要改变它,但如果你真的需要这样做,我没有看到问题......虽然你应该非常小心,因为这种方法可能会导致一个非常混乱和错误的情况。
I think the namespace definition is valid only for a single request, so you should have a mechanism to redefine it every single time.
我认为命名空间定义仅对单个请求有效,因此您应该有一种机制来每次重新定义它。
cheers!
干杯!
#2
0
In my application i have a scenario of superadmin who can view all namespaces hence i need to set them according to request. My issue is resolved now as I was setting namespace after calling getPersistentManger() so it was causing the problem, after shifting NamespaceManger.set at first line of call, and then calling persistent manager, application is working fine:)
在我的应用程序中,我有一个superadmin的场景,他可以查看所有命名空间,因此我需要根据请求设置它们。我的问题现在解决了,因为我在调用getPersistentManger()之后设置了命名空间,所以它导致了问题,在调用第一行调用NamespaceManger.set之后,然后调用持久性管理器,应用程序工作正常:)
#1
0
Can you provide more details or perhaps share some code here? Where are you setting the namespace?
你能提供更多细节或者在这里分享一些代码吗?你在哪里设置命名空间?
In general, you need to set the namespace as soon as you get a request. If you are using Java, for example, you should do that using a Filter. After setting the namespace, all requests operations are going to use this namespace seamlessly. I don't understand why would you need to change that, but if you really need to do that, I don't see a problem... although you should be really careful because this approach may lead to a very confusing and buggy situation.
通常,您需要在收到请求后立即设置命名空间。例如,如果您使用的是Java,则应使用过滤器。设置命名空间后,所有请求操作都将无缝地使用此命名空间。我不明白为什么你需要改变它,但如果你真的需要这样做,我没有看到问题......虽然你应该非常小心,因为这种方法可能会导致一个非常混乱和错误的情况。
I think the namespace definition is valid only for a single request, so you should have a mechanism to redefine it every single time.
我认为命名空间定义仅对单个请求有效,因此您应该有一种机制来每次重新定义它。
cheers!
干杯!
#2
0
In my application i have a scenario of superadmin who can view all namespaces hence i need to set them according to request. My issue is resolved now as I was setting namespace after calling getPersistentManger() so it was causing the problem, after shifting NamespaceManger.set at first line of call, and then calling persistent manager, application is working fine:)
在我的应用程序中,我有一个superadmin的场景,他可以查看所有命名空间,因此我需要根据请求设置它们。我的问题现在解决了,因为我在调用getPersistentManger()之后设置了命名空间,所以它导致了问题,在调用第一行调用NamespaceManger.set之后,然后调用持久性管理器,应用程序工作正常:)