Use the apply operation parameters policy to apply the values of an operation's parameters directly to the cache (CDB).
This example uses the department table from the sampledb database, which is accessible from the "My Sample Database" connection profile.
- To create a mobile business object (MBO), drag and drop the department table from the sampledb onto the Mobile Application Diagram.
- Set the update operation's cache update policy to Apply Operation Parameter.
- Deploy the MBO.
- From Sybase Control Center (SCC) Administration Console, set the MBO's Cache Interval to one hour (or any value long enough to complete this test).
- Sync the MBO from a test client or device application. The client, CDB, and EIS all have the same data:
dept_id dept_name dept_head_id
------- ------------------ ------------
100 R & D 501
200 Sales 902
300 Finance 1293
400 Marketing 1576
500 Shipping 703
- Call the MBO's update operation from the test client or device application to update this record:
dept_id=400, dept_name="QA", dept_head_id=1576
The EIS is modified:dept_id dept_name dept_head_id
------- ------------------ ------------
100 R & D 501
200 Sales 902
300 Finance 1293
400 QA 1576
500 Shipping 703
- Sync the MBO. Based on the apply operation parameters policy associated with this operation:
- The dept_id=400 record is updated using the update operation's parameter values (an inferred read), and becomes:
dept_id=400, dept_name=QA, dept_head_id=1576
-
The CDB and client are updated, resulting in a client and CDB that contains:
dept_id dept_name dept_head_id
------- ------------------ ------------
100 R & D 501
200 Sales 902
300 Finance 1293
400 QA 1576
500 Shipping 703