You are viewing limited content. For full access, please sign in.

Question

Question

Lock document while performing OCR

asked on June 9, 2016

I am performing OCR using the DocumentServices SDK.  Should I lock the document while performing the OCR or will it be acceptable to allow users to view/edit the document while the OCR is being performed?

0 0

Answer

SELECTED ANSWER
replied on June 9, 2016

You should lock the document to avoid having partial changes saved to the document if the user locks a document while it is being OCR'd. Locking also improves indexing performance because the search engine is only notified once to index the document (when it is unlocked) instead of after each individual change.

1 0
replied on June 9, 2016

Thank you for your response...follow-up questions...

 

Does the using statement lock the document or do I still have to lock it inside the using?

 

using (var document = Document.GetDocumentInfo(documentId, session))
{
    document.Lock();   // Is this redundant?

    // Do work
}

 

0 0
replied on June 9, 2016

You need to make the Lock() call, GetDocumentInfo doesn't lock it. It will be unlocked automatically (by IDisposable) when it exits the using block.

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.