OneData 10.7 | Managing Master Data with webMethods OneData | Developing for webMethods OneData | RESTful Web Services | Managing REST Call with Transaction Context | Ending a REST Call with Transaction Context
 
Ending a REST Call with Transaction Context
After you initiate a REST call with the transaction context of transactionId value, it remains in active state, until you complete or end the REST call by issuing an endTransaction request. The endTransaction request also commits or rolls back any DML actions associated to hooks.
Note:
OneData does not support partial commit in a transaction context.
1. Create a POST request to end the transaction with the format:
http://<appsservername>:<port>/<contextRoot>/rest/<repositoryId>/<projectName>/TX/endTransaction
2. Specify the body of the body of the POST request with the following attributes in JSON string format:
*transactionId
*message
*action.Value could be commit or rollback.
Note:
You cannot use multiple transaction IDs in a single endTransaction request.
Examples:
BODY
{"transactionId":"node112_1434955609000","message":"completed","action":"commit"}
{"transactionId":"node112_1434955609000","message":"rolling back due to failure","action":"rollback"}
3. Submit the request.