-
Notifications
You must be signed in to change notification settings - Fork 20
Description
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.