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'm write installer for my web site. Installer creating application pool, virtual directory and
I need to write a forum application for a friend's web site. I want
I write a simple OLAP viewer for my web-site. Here are the classes (abstract
I have inherited some code which involves a scheduled task that writes data (obtained
I'm trying to write to an XML file in the uploads folder in my
I manage a website that pulls data in from an XML file, the file
Each time a users visits my web site pages, several xml elements are written
I have a website here that writes info to and XML file, here is
This magical Ruby script downloads a couple of XML files from a website, but
I write a program to verify this website: www.alipay.com which root CA cert should

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.