WebDAV Transactions

Topic Last Modified: 2006-06-12

Transactions enable WebDAV clients to define units of work (groupings of operations) within a WebDAV virtual server. A transaction is defined as a set of independent operations that are performed as an atomic operation, meaning that the operations succeed or fail as a whole. Because a transaction is defined as a single unit of work, they can also be committed or rolled back.

The existing LOCK Method is used to initiate transactions because it has useful state token semantics. Transactions, however, do not necessarily involve setting shared or exclusive locks on the files involved. It is the client's responsibility to lock files if they want to prevent others from altering the files during a transaction.

Transactions

Several new elements and types are defined which may be used in the XML body of the LOCK Method to implement transactions:

Lock scope: "local"

Lock type: "transaction"

Transaction-type: "groupoperationlocal"

On the successful execution of the LOCK Method with a lock-type of "transaction", the server will return a lock token. This lock token is included in the Transaction Header of the WebDAV methods that are to be a part of the transaction. When the operations are done, the transaction is either committed or aborted using the UNLOCK Method. If a transaction is aborted, then the operations done within the scope of the transaction will not be performed.