I'm looking for a synchronisation method to ensure my back-end data (xml file) is kept intact during multiple client access.
I'm using jaxb to read and write to and from the file. I want to make sure that when a client reads or writes information to the xml file that no other clients are accessing it at the same time.
I've had a read about a ReadWriteLock
and wondering if this is the best solution? Obviously clients should run some sort of query to see if anything is currently being writtern to the file, and if not then go ahead with the read/write?
I'm kind of new to java to excuse my ignorance!
Thanks