Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4043652
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:09:14+00:00 2026-05-20T13:09:14+00:00

My web site writes to XML files. This is an example of the write

  • 0

My web site writes to XML files.
This is an example of the write to: a task xml .

/// <summary>
/// The name of the xml file containing the tasks data.
/// </summary>
private string tasksFile;

/// <summary>
/// The Xml Document that stores the contents of the tasks
/// xml file in memory once loaded.
/// </summary>
private XDocument tasksXml;

........

/// <summary>
/// Writes the xml task file to the disk
/// </summary>
private void SaveTask()
{
    this.tasksXml.Save(this.tasksFile);
}

The tasksXml XDocument is loaded, then processed and only then saved using the Save method.

As more than one user can try to write to the file at the same time, user A might override changes performed by user B.

Edit:
Trying to avoid User A opens, user B opens, both edit, then both save their changes (so only one wins)

  • A. How do I ensure that multiple
    users do not overwrite each other’s
    work?

  • B. Would the term singleton be
    correct – if so how is it
    implemented?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T13:09:15+00:00Added an answer on May 20, 2026 at 1:09 pm

    The only option that I have found that is inline with how I think it should be done is explained in the following link on SO. It uses a temporary file to indicate whether the XML file is “locked”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web site in asp.net that uses a master page. In this
So, I've been having fun with this web site that creates random themes for
I am writing a photo gallery/sharing website and want to (1) write EXIF data
I am developing a web site and need to see how it will look
I writing a web site that uses Active Directory to validate users. I don't
On a PHP-based web site, I want to send users a download package after
I have a web site using apache httpd as the server and mysql as
The win32.perl.org web site provides references to several Perl distributions for MS Windows. For
I've got a web site sending someone a confirmation email. Now in the email
Our company runs a web site (oursite.com) with affiliate partners who send us traffic.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.