Background
I am new to Hazelcast. I'm currently working on an internal tool that uses Hazelcast to cache our data.
Problem
The HazelCast IMap
has a String
key & HashMap<K, V>
value.
We are having an issue with this tool, where inputting an updated HashMap
object with put()
into the IMap
does not update the HashMap
object, refer to sample code below. The V
in HashMap<K, V>
is what gets updated.
Code Structure
In our main code, we have the following:
main() {
updateTableStatus(...);
// other business logic
updateTableStatus(...);
}
The updateTableStatus
code updates the IMap
:
updateTableStatus(...) {
hazelcastInstance.getMap("String").put(K, V);
}
After running the app in debug mode, it seems that the first updateTableStatus
does not update the HashMap
object, only the second updateTableStatus
.
The tool is a SpringBoot application, where the HazelcastInstance object is defined as follows:
@Autowired
HazelcastInstance hazelcastInstance;
I understand that objects saved to the Hazelcast IMap
need to be serializable, but it seems that Hazelcast already has optimized the serialization for HashMap
objects as per link.
My Research/Effort To Debug The Problem
I'm not quite sure what other avenues to explore with regards to updating objects in a Hazelcast IMap
, these were the StackOverflow articles I referred to:
I think Article #3 is the closest to what I'm asking, but his post had no answers, so I'm not sure how else to proceed.
If there is any other missing pieces of information I could provide about the project / Hazelcast setup, please let me know! I'm still new & learning :)
I appreciate any responses & other people's understanding :)