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 6570189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:43:30+00:00 2026-05-25T14:43:30+00:00

I must program a webapp that let’s a user create and modify files. Those

  • 0

I must program a webapp that let’s a user create and modify files.

Those files will be stored on the server. There are mainly two pages in this app : the first one lists the files the user is allowed to see. The user click on one of the item of this list : this let him go to the second page, where he can edit the file.

My problem is simple : I want to make sure that you cannot see, in the first page (list of every files) files that are currently being modified by another user (in the second page). The application is in Java EE using Struts 1 (I didn’t decide about that).

I’ve considered using a static List, for instance, that let me register every files that are currently opened ; I would put a file in the list when a user click and edit the file. In an ideal world, when the user save his work or goes back to the list, I would then remove the file from the list. However:

  1. This is not thread-safe
  2. What if a user just closed the browser?

What way would you proceed to solve this problem?

  • 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-25T14:43:30+00:00Added an answer on May 25, 2026 at 2:43 pm

    Thread safety is easily added to that scenario. The more important issue is that a file needs to be unlocked automatically once a user editing a file goes away, closes his browser, burns down his house or whatever. An automatic release of the file, coupled with some kind of refresh command sent from the browser periodically could solve this problem.

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

Sidebar

Related Questions

I'm using NSMapTable in a program that must run under both 3.0 and 2.2.1.
I have a program that still must target Windows XP (_WIN32_WINNT 0x501), as most
I have program, that must interact with a console program before my program can
Windows 7, Vista, Server 2008, UAC is activated Program must be stated with admin
My program must be run as administrator and creates some files. If I run
I want the user to enter a 4 digit number and the program must
My program must read text files - line by line. Files in UTF-8. I
My program is correct except for that in the end, the program must output
I have lots(+2000) of GUIDs(in some network class) and my program must find one
I must be overlooking something terribly obvious. I need to execute a C program,

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.