[ 
https://issues.apache.org/jira/browse/LUCENE-4246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420710#comment-13420710
 ] 

Robert Muir commented on LUCENE-4246:
-------------------------------------

{quote}
Would close() throw an exception if there were pending (uncommitted, 
un-rolled-back) changes? Ie to avoid the obvious trap of users on upgrading 
assuming close still implicitly calls commit else they silently lose their 
changes.
{quote}

I'm torn here mostly because rollback() closes the IndexWriter. if it didn't do 
this then the path to me seems clear.
But since it does, its confusing.

E.g., just looking at the JDBC Connection api as a parallel, its a little vague 
but I think some impls actually throw Exception here? officially its of 
course...

"It is *strongly* recommended that an application explicitly commits or rolls 
back an active transaction prior to calling the close method. If the close 
method is called and there is an active transaction, the results are 
implementation-defined."

Seeing that we used to commit() on close(), I think its probably best that we 
would throw an Exception (if possible, i have no idea at a glance how). 
Otherwise the behavior change would be a trap... this would make it a lot 
easier.

We already do this if you entered the first phase of a two-phase commit.

But I really don't think we should do anything with pending merges: like i said 
we could have a separate 'graceful slow shutdown' for that that waits for 
merges: its unrelated to transactional semantics.

{quote}
Is it like rollback()? If so, should we remove rollback()?
{quote}

I think we should leave ourselves open to the possibility that one day, maybe 
rollback() can be done without closing.

                
> Fix IndexWriter.close() to not commit or wait for pending merges
> ----------------------------------------------------------------
>
>                 Key: LUCENE-4246
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4246
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>             Fix For: 4.0
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to