The boxcarring functionality is demonstrated here using the RDBMS Sample Service. Boxcarring is enabled for this data service and the following control operations are created: "begin_boxcar", "end_boxcar" and "abort_boxcar". Boxcarring is roughly analogous to transactions we see in database systems. Read about boxcarring and how it is enabled for a data service in Creating Using Various Data Sources.
Follow the steps below to demonstrate this functionality using the TryIt tool:
- Ensure that the
RDBMSSampleService
is deployed as described in Samples Setup. - Log in to the management console of your server and click List under Services in the navigator. See that
RDBMSSampleService
is listed here. - Click Try this service to open the TryIt tool.
- Run employeesByNumber operation with the employeeNumber 1002. Output is as follows:
- Run the "begin_boxcar" operation and the service will switch to a boxcarring session.
- Run the "incrementEmployeeSalary" operation and give the values "1000" for increment and "1002" for the employeeNumber fields.
- Open up a different type of a browser for the service to have a fresh session, so it won't be in the same boxcarring session as earlier. After switching browsers, run the "employeesByNumber" operation with employeeNumber=1002 to check the employee information.
- Note that the salary is not incremented. The reason is that the request made earlier in boxcarring mode is not executed immediately. It is executed when the boxcarring session ends.
- Go back to the original browser, run the "incrementEmployeeSalary" operation and give the values "500" for increment and "1002" for the employeeNumber fields. Then, run the "end_boxcar" operation.
- Next, in any of the two browsers, run the "employeesByNumber" operation with employeeNumber=1002 to check the information. The output will be similar to the following:
...