Refresh settings after db change #29
Replies: 3 comments
-
|
In general, I think switching the database connection is not ideal at all and will also probably cause problems with doctrine in other places... The cache snippet you have shown, is only for the FileStorage Adapters, if you are using doctrine, then this works differently (and doctrine is the cache), and you probably need to refresh the underlying doctrine entities or clear the whole entity manager... |
Beta Was this translation helpful? Give feedback.
-
|
Looks like doctrine does handle switching database normally... I think there's no problem here, as most multi-tenancy systems does that. AFAIK the I've added an Sorry if i miss something in the code, but this fix worked. If you think there's a path here, i can improve the code. |
Beta Was this translation helpful? Give feedback.
-
|
Code sample: https://github.com/pedrocasado/reload-settings |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to clear the cache or reload settings from db?
I switch between connections, but after that the settings classes doesn't update, even after reload() or resetToDefaultValues;
This is how i change db:
I see that this looks like its related to cache. Maybe we could add a ->clearCache() method in ORMStorageAdapter?
Beta Was this translation helpful? Give feedback.
All reactions