Locking Documents

Is their a way to lock all documents of a document type so that one process can exclusively process these documents without being interfered by other processes?


Regards,
Rudolf de Grijs

Rudolf,

there is no mechanism to lock an entire doctype in one step. The locking mechanism locks every “touched” document from a user, so in order to lock the entire doctype you have to issue a query which gets all documents. This might take some time for large databases!

sorry, no easier way here.

regards,

Timm

What about using _isolationLevel=serializable? Fromanother thread it says:

For _isolationLevel=serializable Tamino acquires shared locks on entire doctypes.



Bill

_isolationLevel=serializable acquires only shared locks on doctype level but no exclusive ones. There is no way to get an exclusive lock on doctype level.

If you start the transaction with _isolationLevel=serializable and use _lockMode=protected for your query, then only dirty read queries can access documents in your doctype as long as your transaction exists. Concurrent transactions cannot update/insert/delete documents in the affected doctype. Nevertheless Tamino has to acquire exclusive locks for every single document that is accessed within your query.

Regards,
Michael