Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have an XML tree which stores the relationship between folders and video files. So each folder could be the artists name and below it we have the videos of the artist. Also each folder can have other sub folders.

This tree structure can be accessed by multiple users where some users could be deleting videos, others moving videos between folders and others possibly renaming folders.

What I need is a mechanism where I lock parts of the tree when one user is working on it and when multiple users all work on their parts of the tree, when they make their changes, the tree is not corrupted. Is this possible to implement when using XML?

share|improve this question
Where do you store the XML tree you want to modify? (main memory, file, database,...) – Bernd Feb 9 '12 at 13:47
up vote 2 down vote accepted

You will need control over all of the code that is accessing the XML. There is nothing inherently built into XML that XML editors, text editors and other programs will respect as a locking feature.

If you control the code, there are a number of ways to go. The easiest way is probably to add a "LockedBy" attribute to the XML node you want to lock.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.