chets patel wrote:
what if I store this map in some application context and fetch it in local variable whenever required?
S Thiyanesh wrote:Its a synchronization issue due to race condition.
If you have this logic, then you need to use synchronized.
Retrieval operations (including get) generally do not block, so may overlap with update operations (including put and remove). Retrievals reflect the results of the most recently completed update operations holding upon their onset.
The allowed concurrency among update operations is guided by the optional concurrencyLevel constructor argument (default 16), which is used as a hint for internal sizing. The table is internally partitioned to try to permit the indicated number of concurrent updates without contention.