We have a requirement as follows for handling XML files in C# code.
Please provide logic/solution in such a way to achieve this.
Problem:
We have an XML file,assume it has test.xml
.
When a user 'A' working with test.xml then we want the requirement that to lock this XML and to process like read/write etc.
In the sametime a user 'B' also tried to access the test.xml , we want the requirement that user 'B' should not able to open and 'B' has to wait until the lock of user 'A' is to be release or unlock.
Also we shouldn't get any error/exception till the user 'B' is in waiting mode and we don't want to show any message to the user .
As we are not interested to use FileStreams in this scenario due to performance issue.
Can anyone help in this regard how to overcome this type of issue.
Please Note:
We do not want to use filestreams.
Please suggest an alternative solution in this regard.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…