Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutable caches #169

Open
ZakarFin opened this issue Mar 24, 2020 · 0 comments
Open

Mutable caches #169

ZakarFin opened this issue Mar 24, 2020 · 0 comments
Labels

Comments

@ZakarFin
Copy link
Member

ZakarFin commented Mar 24, 2020

Caches are used in oskari-server to improve performance but the cached objects are mutable. This introduces a problem where calling setters on cached objects like OskariLayer.setUrl() modifies the cached object which makes the cached objects go out-of-sync with the database. This might result in difficult to debug situations where some functionality might break after maybe even another user has used a totally unrelated functionality that has modified cached objects.

For example in oskariorg/oskari-server@972c50e the url and layer name is modified on OskariLayer and any future calls to OskariLayerService.find(layerId) will receive the modified OskariLayer from cache until the cache has been flushed and the cached data is repopulated from the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant