Hi Andreas,

> Is REPLACE atomic in the sense that an
> ongoing request will see the „old“ state of the document and new requests will
> see the new state of the document without any undefined state in between?

The transaction manager of BaseX guarantees that there will be no
conflicting requests on updated documents (see [1] for more details),
so you’ll be safe when using REPLACE.

> Should I uploaded the new version of a catalog under a different
> filename first and then use REPLACE?

This mostly depends on how you use BaseX: If you use our HTTP services
(e.g. the PUT method with REST, which is comparable to executing
REPLACE), everything could be done in a single step. If you use a
separate web server, and only use the client/server architecture of
BaseX, uploading the file first may be a good idea.

Feel free to tell us more about your architecture,
Christian

[1] http://docs.basex.org/wiki/Transaction_Management

Reply via email to