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

  • Home
  • SEARCH
  • 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 1108403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:04:39+00:00 2026-05-17T02:04:39+00:00

My scenario is : I’ve an excel sheet. Some threads need to modify it

  • 0

My scenario is :
I’ve an excel sheet. Some threads need to modify it at the same time.

I need to implement this and I’m looking for a best practice solution.
synchronizedmethod could be a solution? If yes, then wouldn’t it create starvation problem or every thread may have to wait for long time?

Is any other way round?

  • 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-17T02:04:40+00:00Added an answer on May 17, 2026 at 2:04 am

    An Excel sheet shouldn’t be used as working memory. With a resource like that, you have to manage access to it. You can’t just let threads try to write to it willy-nilly. I doubt you will find a java Excel module which supports concurrency.

    Create a data structure which contains all the data. At the beginning of the process, load the Excel sheet into this data structure. Have the threads modify this data structure instead of the excel spreadsheet. Periodically, or when changes are complete, export the data structure contents back to the Excel spreadsheet.

    You will have to handle data concurrency issues yourself. There is no native transaction handling here. You want to make sure you don’t write a copy of the spreadsheet that one thread has made some changes to, but not its complete set. This could create confusing results. Also, if two threads are modifying the same data at the same time, that would be confusing too.

    Ideally, in a situation like this, the data is held in a database somewhere. This is an ideal place to store data that is concurrently modified by multiple threads. Mainly, it also supports transactions. If you go with this solution, you could create a script which just polls the database every five minutes and updates the Excel spreadsheet.

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

Sidebar

Related Questions

Scenario first :- I'm using Entity Framework to do some queries, to build my
Scenario: There is a website with 700-900 concurrent unique visitors at any given time.
Scenario: I have configured SQOOP on my PC. But I am facing some problem
Scenario: At our company, we have enabled httpCompression for our website. This website (call
Scenario: User is viewing a screen with an image and some accompanying text in
Scenario For a multiple file uploader I am implementing, I need to have a
Scenario 1 (That Works) This is a POC i created. I have a script
Scenario I have an web application which needs some calculations and processing on data.
Scenario: I am trying to migrate a C++ application to WinRT/Metro Style. This application
Scenario: A new blank Magento with a category product and customer import with some

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.