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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:09:52+00:00 2026-06-11T05:09:52+00:00

I am googling for two days… I really need help. I have an application

  • 0

I am googling for two days… I really need help.

I have an application with multiple threads trying to update a lucene index using Open/Close of IndexWriter for each update. Threads can start at any time.

Yeah, the problem with write.lock! So there are may be two or more solutions:

1) check IndexWriter.IsLocked(index) and if it is locked to sleep the thread.
2) Open an IndexWriter and never close it. The problem is that I have another application using the same index. Also when should I close the index and finalize the whole process?

here are interesting postings
Lucene IndexWriter thread safety
Lucene – open a closed IndexWriter

Update:
Exactly 2 years later I did a rest API which wraps this and all writes and reads were routed to the API.

  • 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-06-11T05:09:53+00:00Added an answer on June 11, 2026 at 5:09 am

    Multiple threads, same process:

    Keep your IndexWriter opened, and share it across multiple thread. The IndexWriter is threadsafe.

    For multiple processes, your solution #1 is prone to issues with race conditions. You would need to use named Mutex to implement it safely:
    http://msdn.microsoft.com/en-us/library/bwe34f1k.aspx

    That being said, I’d personally opt for a process dedicated to writing to the index, and communicate with it using something like WCF.

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

Sidebar

Related Questions

While googling I found two different sets of headers that need to be set
I have been googling and stackoverflowing for the last two hours and couldn't find
What I'm trying to do is fairly simple. I have two classes: public class
I have the following two questions, I tried googling these, but didn't find any
I am trying to validate two checkbox lists in my usercontrole.after some googling i
Googling this does little good, as you can imagine. Does anyone have resources that
Started Googling today to research implementing Zend_Translate in a Zend 1.6.x project i have
After googling i came to know that Index seek is better than scan. How
I've spent my requisite two hours Googling this, and I can not find any
Twice in the past two days, I've had a problem with my emacs sessions.

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.