Yes, the problem goes away when I do the following:
synchronized(doc)
{
doc.add(field);
}
Thanks.
[I'll use a Lock to do this properly]
-glen
2008/10/31 Yonik Seeley <[EMAIL PROTECTED]>:
> On Fri, Oct 31, 2008 at 11:53 AM, Glen Newton <[EMAIL PROTECTED]> wrote:
>> I have concurrent threads adding Fields to the same Document, but
>> getting some odd behaviour.
>> Before going into too much depth, is Document thread-safe?
>
> No, it's not.
> synchronizing on Document when adding a new field would probably be
> the easiest fix for you.
>
> -Yonik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
-
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]