Well I'm at a loss then.  The version should only increment on commit.

Can you make it all happen when infoStream is on, and post back?

Mike

On Mon, Feb 22, 2010 at 12:35 PM, Peter Keegan <peterlkee...@gmail.com> wrote:
> Only one writer thread and one writer process.
> I'm calling IndexWriter(Directory d, Analyzer a, boolean create,
> MaxFieldLength mfl), which sets autocommit=false.
>
> Peter
>
> On Mon, Feb 22, 2010 at 12:24 PM, Michael McCandless <
> luc...@mikemccandless.com> wrote:
>
>> That's curious.
>>
>> It's only on prepareCommit (or, commit, if you didn't first prepare,
>> since that will call prepareCommit internally) that this version
>> should increase.
>>
>> Is there only 1 thread doing this?
>>
>> Oh, and, are you passing false for autoCommit?
>>
>> Mike
>>
>> On Mon, Feb 22, 2010 at 11:43 AM, Peter Keegan <peterlkee...@gmail.com>
>> wrote:
>> > Using Lucene 2.9.1, I have the following pseudocode which gets repeated
>> at
>> > regular intervals:
>> >
>> > 1. FSDirectory dir = FSDirectory.open(java.io.File);
>> > 2. dir.setLockFactory(new SingleInstanceLockFactory());
>> > 3. IndexWriter writer = new IndexWriter(dir, Analyzer, false,
>> maxFieldLen)
>> > 4. writer.getReader().getVersion();
>> > 5. writer.prepareCommit();
>> > 6. writer.getReader().getVersion();
>> > 7. writer.commit();
>> > 8. writer.close();
>> >
>> > I'm using the version number to keep external data in synch with the
>> index.
>> > Usually, the version number from (6) is 1 greater than from (4) and the
>> > version from (4) equals the version from the previous (6). At least once
>> a
>> > day, however, the version from (4) is 1 greater than from the previous
>> (6).
>> > What would explain this sporadic behavior of version numbers?
>> >
>> > Thanks,
>> > Peter
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
>> For additional commands, e-mail: java-user-h...@lucene.apache.org
>>
>>
>

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

Reply via email to