Date: Thu, 28 Mar 2024 11:28:13 -0400 (EDT) Message-ID: <1046139185.28089.1711639693017@lyrasis1-roc-mp1> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_28088_218853849.1711639693017" ------=_Part_28088_218853849.1711639693017 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
After retrieving a transaction resource using the REST API, clients can send= additional REST API calls within the scope of that transaction. After comm= itting the transaction, the pending changes will be persisted in a single a= tomic operation. Validation, event-driven workflows, and other asynchronous= operations are not triggered until the transaction is committed, which may= provide a performance increase for some types of iterative tasks. Transact= ions can also be rolled back, as if they never occurred.
curl -v -X POST "http://localhost:8080/rest/fcr:tx"
Create a transaction. In the response, the Location header will contain = a path to the created transaction
Status: 201 Created =20 Headers: Location: http://localhost:8080/rest/tx:83e34464-144e-43d9-af13-b3464a1fb9b= 5 Expires: Sat, 16 Nov 2013 00:32:57 GMT
The expires header indicates when the transaction will be automatically = rolled back due to inactivity.
Transactions are automatically closed and rolled back after 3 minutes of= inactivity. Transactions can be refreshed by POSTing to /rest/{tx:id}/fcr:tx=
API requests can be prefixed with the transaction identifier:
curl -X POST "http://localhost:8080/rest/tx:83e34464-144e-43d9-af13-= b3464a1fb9b5/path/to/object/to/create" curl -X DELETE "http://localhost:8080/rest/tx:83e34464-144e-43d9-af13-b3464= a1fb9b5/path/to/resource/to/delete"
You can send most API requests scoped by the transaction. API requests t= hat are not prefixed by a path to the node do not occur within the scope of= a transaction and cannot be used (e.g. fcr:nodetypes, fcr:namespaces, etc)=
curl -X POST "http://localhost:8080/rest/tx:83e34464-144e-43d9-af13-= b3464a1fb9b5/fcr:tx/fcr:commit"
Until the transaction is committed, no other client will see the changes= made within the scope of the transaction. After committing, the changes wi= ll be applied to the workspace and all clients will be able to see the chan= ge.
Fedora 4's transactions do NOT support checkpointing. After committing a= transaction, it is closed, and any further operations on that transaction = will be rejected.
curl -X POST "http://localhost:8080/rest/tx:83e34464-144e-43d9-af13-= b3464a1fb9b5/fcr:tx/fcr:rollback"
The changes made within the scope of the transaction will be erased, and= the transaction closed and removed.