1 of 1 people found this helpful
1. I would not recommend updating the cache in such a way. Depending on how this is configured, you could cause a deadlock, since the primary owner could be holding the lock while the store is updating on a backup. Then when the replace is fired it would again try to acquire the lock on the primary, but be unable to.
2. Sure, but you need to use pessimistic transactions to do this. You can use the FORCE_WRITE_LOCK flag while invoking a get to lock the key in the current transaction. It is briefly talked about at Infinispan 9.3 User Guide
3. The preload flag on the store as detailed in Infinispan 9.3 User Guide
Thanks for the clarifications.
But there still something unclear for me.
1. I will use our existing hibernate/jpa dao services for read and write throgh store. So after I save the entry over my dao service the actual entry reference is changed because of the merge from the entity manager.
So I need to replace the entry. Is there a clear solution?
2. I find that out today, that the reader must set a lock to
3. I recognize that flag in the docu but I derived my custom store from the advanced store and bot from the custom store. Which override I need for initial loading?
1. Have you tried using the functional commands in the ConcurrentMap interface, such as merge? You could also try out our functional API as well.
3. You have to implement AdvancedCacheLoader or one of its subclasses. The various SPI classes are better described at Infinispan 9.3 User Guide. In this case implementing this method will make it so that your loader will participate in preload and other bulk operations (eg. size and streams). The interface AdvancedLoadWriteStore implements both advanced loader and writer.
Also to note if you are using Infinispan 9.3 the AdvancedCacheLoader interface has some new improvements. We support using new publishEntries/publishKeys methods instead of the old `process` method. You can still use process if you would like, but the new ones perform better.
If you need help implementing a Publisher, we internally use rxjava2, but you can use any of the reactive streams implementations that are available, such as rxjava2, akka streams and reactor to name a few. You can take a look at the existing implementations we have in Infinispan to help.
Single file store
Here is our JPA store implementation one btw:
Thank u well for the suggestions.
I will check this out after my holiday