On 2/19/07, Ryan McKinley <[EMAIL PROTECTED]> wrote:
On 2/19/07, Chris Hostetter <[EMAIL PROTECTED]> wrote: > > : If you commit a document while the updater is autocommiting, it is > : likely to immediatly start another autocommit (unless you are also > : using maxDocs). > > i don't really understand how the autocommit stuff is safe from > concurency issues...
AutoCommit is protected by the iwCommit lock, which is mutually exclusive with the iwAccess lock. If a commit is occurring, addDoc() calls should block on acquiring the latter lock.
tracker.addedDocument() is only called from the synchronized block within updateHandler.addDoc(AddUpdateCommand cmd); it is called between iwAccess.lock(); and iwAccess.unlock(); That should make sure it is not started more then once. (java threading and concurrency still feels a little like voodoo, so I could be missing something)
iwAccess is not a self-exclusive lock, so this would not be sufficient protection. However, the autocommit stuff _is_ called within a synchronized block in that method (which is partly what the extra synchronization is there for). Thanks for looking at this before I got the chance, Hoss. -Mike