moqui / moqui-framework

Use Moqui Framework to build enterprise applications based on Java. It includes tools for databases (relational, graph, document), local and web services, web and other UI with screens and forms, security, file/resource access, scripts, templates, l10n, caching, logging, search, rules, workflow, multi-instance, and integration.
http://www.moqui.org
Other
284 stars 204 forks source link

Different Tenant use same Localized Message #29

Closed fengbaicanhe closed 8 years ago

fengbaicanhe commented 8 years ago

I try to add a new tenant named demo-tenant use the new function 'Tenant Admin', This works very well.

And then i add some localized Message to tenant demo-tenant, after i added, the button's display do not changed, so i tried clear all caches, then it works, some button display correctly.

Then i login in with tenant DEFAULT, some buttons display as same as tenant demo-tenant.

here is the issues:

  1. after localized message added, cache do not refresh.
  2. Different Tenant use same Localized Message( i think this is different tenant share the same localizemessage cache )

i test these issues in version:

  1. release 1.6.0
  2. release 1.6.1
  3. moqui-framework master branch
fengbaicanhe commented 8 years ago

the localize i used is zh

jonesde commented 8 years ago

For part 1 it could be improved, but currently the design is for localized messages to be cached and cleared on a timeout or manually since in production they don't change very often. In dev mode there is already a an expiration after 10 minutes. In production there was no expiration, but I'm changing that to default to 1 hour. It could be improved by code that explicitly clears cache elements when LocalizedMessage records are updated.

Part 2 of this issue relates to an issue I identified last week in my multi-tenant testing. There are various caches that need to be per-tenant that currently are not, and the localized message cache is one of them. My plan is to make all caches per-tenant, just like databases and ElasticSearch indexes and so on. This relates to another issue I have on my list which is that tenants have access to caches of other tenants in the System app, and making all caches per-tenant (except perhaps allowing a share across tenants setting for certain caches) will make it easier to filter these in the cache screens in the system app (just like the tenant entities, elastic search indexes, etc already are).

fengbaicanhe commented 8 years ago

Yes,I expect all caches per-tenant, and thank you to create this nice framework!