Making a shared database exclusive, on a temporary basis
I have a labelling program, that is being used by more users. Sometimes when someone is working in it, and creating several labels, another opens the file and deletes by this automatically all the labels made. I need this deletion, because every labelling request is a new one.
I want user #1 to set the file exclusive to him and when he finishes working on it, making it open again for other users. I want user #2 see a message that user #1 is working in this file.
How can this be done?