I have the need to store key value pairs which should preserve the order. Reverse or forward does not matter.
The environment is multi threaded so this structure need to be thread safe as well. During specific events I need to read the entire map push to db and clear all.
This structure is supposed to be shared so it is possible that other threads attempt to write into it at the same time.
I initially used a LinkedHashMap but it is not thread safe and so I am hitting concurrentModificationException