16 Jun
2014
16 Jun
'14
1:08 p.m.
Dear Alister,
I wonder what strategies other people use to lock a file for “editing”, or “checkout” a file so that only a single user has access (in a multi-user environment).
We usually apply the XQuery locking options [1]: From all XQuery expressions that reference the same lock string, only one writing process will be run one at the same time. This can e. g. look as follows: read.xq: declare option query:read-lock "config"; file:read-text("config.xml") write.xq: declare option query:write-lock "config"; file:write-text("config.xml", 'blablabla') Hope this helps, Christian [1] http://docs.basex.org/wiki/Transaction_Management#XQuery_Locking_Options