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

Question

Question

self-hosted temporary workflow locks

asked on August 28 Show version history

If a workflow places a temporary lock on a document to upodate it's metadata, can another process (API or client) retrieve the document for read-only access?

That's very hard to test give the milliseconds involed.

Does moving a document a place any kind of lock on it? I assume not and as long as I have the doc's entry id, all should be fine. Can someone confirm please. 

Does the LF repo manage a timeout (200ms to 400ms perhaps) when an API request encounters a lock?

-Ben

0 0

Answer

SELECTED ANSWER
replied on August 28

Yes, you can read a document while it's locked for writing (though, obviously, you'd be looking at the last changed version of it and it wouldn't reflect any changes made by whoever is writing to it). Moving the document does not lock it but it may lock folders in its path.

As for testing, you can get a longer running lock if you open the document in the web or Windows clients and change a metadata field. That acquires a write lock on the document and holds it until the user saves their changes or the session is disconnected. It's not any different than Workflow locking the document, but it does keep it locked while you have changes pending, so it gives you time to experiment.

The server does not time out locks. The locks stays until the caller releases it or the session is disconnected. Any attempts to lock the document would get a 9014 ("object is locked") error and it would be on the calling app to give up or implement a retry policy since it would be dependent on their intent. For ex, the web and Windows clients return the error to the user, while Workflow will set the document aside and try again later a few times. This is done to manage the user experience (fail fast when there's a user looking and let them choose when/if retry is needed versus trying to manage the error as much as possible in order to move their workflow forward). 

0 0
replied on August 28 Show version history

Thanks - I didn't want to assume the lock created by the UI was the same as the one created by the workflow. But usually when people ask this kind of question, the answer is "all products use the same API." 

0 0
replied on August 29

That would the answer, all products use the same APIs.

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.