I was able to reproduce the shared flag being ignored in 8.2.3.Final and It seems that there is an underlying issue here. What version of infinispan are you currently utilising?
I have created  to track the issue and I will look into this soon.
Thanks for your prompt reply and the confirmation on the bug, this has been troubling us for few days. I am currently using 7.1.0, I have tested multiple versions including the latest, they seem all have the same issue. Is there any quick fix or ways to walk around this?