Skip to content

Mutable caches #169

@ZakarFin

Description

@ZakarFin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions