This documentation is for WSO2 Data Services Server 3.2.2. View documentation for the latest release.
Page Comparison - Batch Processing Sample (v.2 vs v.3) - Data Services Server 3.2.2 - WSO2 Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents

Building the sample

Create a The sample data service by the name BatchRequestSample , BatchRequestSample should be deployed using the instructions in Samples Setup.

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 Data Services Clients.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 Data Services Clients section, run the command "ant batch_request" , command to run the sample. The output will resemble the following:

...

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.

...