[ 
https://issues.apache.org/jira/browse/LUCENE-1314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Rutherglen updated LUCENE-1314:
-------------------------------------

    Attachment: LUCENE-1314.patch

{quote} 
"Changed DirectoryIndexReader. acquireWriteLock to throw an
UnsupportedOperationException (rather than a
LockObtainFailedException) when the reader is readonly because
TestIndexReader.testReadOnly was failing"

We can't really make that change - it's technically a change to back
compat. Can we just fix the test that was failing (why was it
failing?). 
{quote}

It's been added in this patch so there isn't a back compat issue. I'm
not sure why it wasn't being thrown in previous testing.
acquireWriteLock in ReadOnly*Reader throws
UnsupportedOperationException making the patch compatible with
existing behavior.

{quote} 
"Cloning a read only reader into a writeable reader throws an
exception."

Why not allow this? (It shouldn't be hard to allow it?) 
{quote} 

While it seem logical, it's not allowed because the read only reader
doesn't hold the write lock which it needs to pass on to the
writeable reader. 

SegmentReader.readOnly variable removed

All tests pass


> IndexReader.clone
> -----------------
>
>                 Key: LUCENE-1314
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1314
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Index
>    Affects Versions: 2.3.1
>            Reporter: Jason Rutherglen
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, 
> LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, 
> LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, 
> LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, lucene-1314.patch, 
> lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, 
> lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, 
> lucene-1314.patch, lucene-1314.patch, lucene-1314.patch
>
>
> Based on discussion 
> http://www.nabble.com/IndexReader.reopen-issue-td18070256.html.  The problem 
> is reopen returns the same reader if there are no changes, so if docs are 
> deleted from the new reader, they are also reflected in the previous reader 
> which is not always desired behavior.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to