Table of Contents
Building the sample
Create a The sample data service by the name
BatchRequestSample should be deployed using the instructions in .
Running the sample
The sample service can be run using the TryIt tool, which is bundled with the WSO2 Data Services Server, or a code-generated java client sample as discussed in .Follow these instructions to demonstrate the functionality using a data service client:
The command line application is used here to present the functionality of batch processing. As shown in the command "ant batch_request" , command to run the sample. The output will resemble the following:section, run the
The sample tests batch processing by executing a batch operation with three parameter tests, which means, it effectively executes three consecutive operations. The operation is to add a new employee to the database. Here we execute the batch operation and checks for the existence of the three newly added entries. A requirement of batch operations is, if one invocation fails, then all the other operations in the batch should fail. This can be seen here, where the sets of three employee entries are either inserted together, or none of them are inserted. In this sample, a validator is used for checking if a valid email address is given when adding a new employee entry to the database. If the email is invalid, that operation invocation fails.
There In this sample data service, there are four such batch requests executed as explained below.