Suppose I have a Json file, How to prevent lost update if I have multiple instance of a java application writing to it?