You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Grant Ingersoll <gs...@apache.org> on 2007/04/15 19:36:41 UTC

Commits and Container Shutdown

Hi,

I am just confirming that shutting down the container causes a commit  
when using the DirectUpdateHandler2, correct?  For example, if I  
index some documents but don't commit them and then shutdown the  
servlet container, upon startup those documents will be in the index  
as if they were committed, right?  I have tested this and it appears  
to be the case.  This is happening b/c Solr is writing to the  
underlying index and not using some temporary index, right?  Or is it  
b/c there is a shutdown hook that fires a commit command?

Thanks,
Grant


Re: Commits and Container Shutdown

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 15, 2007, at 1:36 PM, Grant Ingersoll wrote:
> I am just confirming that shutting down the container causes a  
> commit when using the DirectUpdateHandler2, correct?  For example,  
> if I index some documents but don't commit them and then shutdown  
> the servlet container, upon startup those documents will be in the  
> index as if they were committed, right?  I have tested this and it  
> appears to be the case.  This is happening b/c Solr is writing to  
> the underlying index and not using some temporary index, right?  Or  
> is it b/c there is a shutdown hook that fires a commit command?

It is definitely the case that Solr writes to the main index, and  
does not use a temporary index - so if documents have been added but  
not committed, they will be "committed" effectively by restarting  
Solr and opening a new IndexSearcher.

Further details on this: SolrCore has a finalizer() method that  
closes the update handler.  I'm not clear on finalizer() though.  How/ 
when is that invoked?   I know about Object.finalize(), but not  
finalizer().

	Erik