Skip to main content

changeset

The order of execution within a changeset is not defined. This differs from the whole batch request itself, where the order is defined. Therefore, the requests within one changeset should not depend on each other. If the execution of any request within a changeset fails, the whole changeset will be reflected as an error in the response. The changeset will not be applied, much like a database transaction.

Unlike retrieve requests, you can not pass change requests to the batch() function directly. You have to wrap them with the changeset() function, which in turn can be passed to the batch() function. Once a batch request is executed, it returns a list of BatchResponse objects.

If a changeset was executed successfully, its corresponding response is of type WriteResponses and contains a collection of all raw responses to the requests in the changeset. If the execution fails, the response is an ErrorResponse instance.

In the example below, you create a list of UpdateRequestBuilder instances from a list of addresses. Combine these change requests into one changeset and pass it to the batch request, which you execute against a destination.

Once you execute the batch request, you get a list of BatchResponse instances, which in this example contains one response only, i.e. the one for the changeset.