You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Friso van Vollenhoven <fr...@func.nl> on 2005/03/02 15:13:31 UTC

possible concurrent actions table

Hi,

I found this table at jGruru:
http://www.jguru.com/forums/view.jsp?EID=910778

Since the table seems to be about 2.5 years old, I was wondering if it is
still correct.

It says that I can concurrently delete and read a document. So if there
are two threads using one IndexReader instance, they could concurrently
read and delete a (possibly the same) document.

And if the threads do not share a single IndexReader instance. Will the
reading thread still see the document when the deleting thread has deleted
(and commited) it (if both IndexReader instances were opened when the
document was not yet deleted).


Thanks to anyone who knows and answers,

Friso



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: possible concurrent actions table

Posted by Volodymyr Bychkoviak <vb...@i-hypergrid.com>.

Friso van Vollenhoven wrote:

>Hi,
>
>I found this table at jGruru:
>http://www.jguru.com/forums/view.jsp?EID=910778
>
>Since the table seems to be about 2.5 years old, I was wondering if it is
>still correct.
>
>It says that I can concurrently delete and read a document. So if there
>are two threads using one IndexReader instance, they could concurrently
>read and delete a (possibly the same) document.
>  
>
document(int) and delete(int) are synchronized methods, so they can be 
used in different threads. However you'll get IllegalArgumentException 
trying to retrieve deleted document.

>And if the threads do not share a single IndexReader instance. Will the
>reading thread still see the document when the deleting thread has deleted
>(and commited) it (if both IndexReader instances were opened when the
>document was not yet deleted).
>  
>
reading IndexReader instance will not see changes until reopened. (also 
this instance will be unable to delete documents as well)

>
>Thanks to anyone who knows and answers,
>
>Friso
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>  
>

Regards,
Volodymyr Bychkoviak

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: possible concurrent actions table

Posted by Otis Gospodnetic <ot...@yahoo.com>.
I think the table is still up to date, but the most comprehensive
explanation of concurrency rules that I know of is in Chapter 2 of
Lucene in Action:
  http://www.lucenebook.com/search?query=concurrency+rules

As you can see from the 1st hit snippet, it really all boils down to
eliminating concurrent disk modifications.

Otis


--- Friso van Vollenhoven <fr...@func.nl> wrote:

> Hi,
> 
> I found this table at jGruru:
> http://www.jguru.com/forums/view.jsp?EID=910778
> 
> Since the table seems to be about 2.5 years old, I was wondering if
> it is
> still correct.
> 
> It says that I can concurrently delete and read a document. So if
> there
> are two threads using one IndexReader instance, they could
> concurrently
> read and delete a (possibly the same) document.
> 
> And if the threads do not share a single IndexReader instance. Will
> the
> reading thread still see the document when the deleting thread has
> deleted
> (and commited) it (if both IndexReader instances were opened when the
> document was not yet deleted).
> 
> 
> Thanks to anyone who knows and answers,
> 
> Friso
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org