This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Read/Write xml file from servlet  RSS feed

 
Rajesh Agarwal
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an xml file which will be read/written from the servlet on the fly.
Basically web enabling the editing of an xml file.

What is the recommended architecture. I am basically focussing on the concurrency problem, that is when 1 person reads, the other person should not write. With my design it allows for dirty reads.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simultaneous editing of the same document by multiple users certainly does present a problem. If you can't avoid the possibility then you would need to ensure that only one copy of the Document object can exist at one time and that methods to modify that document are properly synchronized.
The simplest thing would appear to be allowing multiple users to read, but only one user to modify the Document.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!