void () { ThreadingAssertions.assertEventDispatchThread(); ((TransactionGuardImpl)TransactionGuard.getInstance()).assertWriteActionAllowed(); if (myUncommittedDocuments.isEmpty()) return; Document[] documents = getUncommittedDocuments(); for (Document document : documents) { if (isCommitted(document)) { if (!isEventSystemEnabled(document)) { // another thread has just committed it, everything's fine continue; } LOG.error("Committed document in uncommitted set: " + document); } else if (!doCommit(document)) { LOG.error("Couldn't commit " + document); } } LOG.assertTrue(!hasEventSystemEnabledUncommittedDocuments(), myUncommittedDocuments); }