01.06.2013 Views

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

saveChanges( ) method<br />

saveChanges( ) method<br />

Synchronizes to the AppServer all changes made to JSDO local storage since the last<br />

call to the fill( ) or saveChanges( ) method. The saveChanges( ) method<br />

completes this data synchronization by invoking appropriate built-in resource<br />

operations on each changed record, one at a time, and in the following general order<br />

of operation type:<br />

1. "delete" — All record deletions are applied, one at a time across the network.<br />

2. "create" — The creation of all new records is applied, one at a time across the<br />

network.<br />

3. "update" — Updates are applied to all modified records, one at a time across the<br />

network.<br />

The sending of changes for multiple operations on the same record is optimized, so the<br />

fewest possible changes are sent to the AppServer. For example, if a record is<br />

updated, then deleted in local storage, only the deletion is sent to the AppServer.<br />

Note: In the current release, there is no batching of built-in record-change<br />

operations. That is, the built-in delete operation is invoked over the network for<br />

each deleted record, followed by the built-in create operation for each created<br />

record, and finally by the built-in update operation for each updated record. So,<br />

even for a ProDataSet, a built-in record operation executes over the network<br />

only one record at a time and cannot be part of a transaction.<br />

After execution, the working record for each temp-table referenced by the JSDO is not<br />

set.<br />

Return type: null<br />

Applies to: progress.data.JSDO class<br />

Syntax<br />

saveChanges ( )<br />

This method always executes asynchronously, and fires the following JSDO named<br />

events, as required by JSDO changes, and shown in operational order:<br />

1. beforeSaveChanges event<br />

2. beforeDelete event<br />

3. afterDelete event<br />

4. beforeCreate event<br />

5. afterCreate event<br />

6. beforeUpdate event<br />

7. afterUpdate event<br />

8. afterSaveChanges event<br />

<strong>OpenEdge</strong> ® <strong>Development</strong>: <strong>Mobile</strong> <strong>Applications</strong> 241

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!