1
votes

I want to use hazelcast as a cache provider for spring. Let say I am able to configure cluster and pick proper hazelcast CacheManager implementation.

I want to be sure hazelcast cache supports 'sync' annotation attribute as described here

I want to be sure writing code like

@Cacheable(cacheNames="foos", sync=true)
public Foo executeExpensiveOperation(String id) {...}

...would guarantee for me that the entry will be locked while cache value will be computed by CacheLoader.

Do modern versions of hazelcast supports synchronous cache implementation?

I know there is distributed read-through IMap with similar behavior as a synchronized cache. And I can explicitly lock map entries by a key. Should I use these structure as an alternative?

1

1 Answers

3
votes

Yes it is supported as of 3.7 as this pull request indicates. It also works if you're using Hazelcast as a JSR107 provider as Spring's JCache abstraction implements this contract as well.