Upload operation replay records asynchronously.
When an application calls submitPending on an MBO on which a create, update, or delete operation is performed, an operation replay record is created on the device local database.
When synchronize is called, the operation replay records are uploaded to the server. The method returns without waiting for the backend to replay those records. The synchronize method downloads all the latest data changes and the results of the previously uploaded operation replay records that the backend has finished replaying in the background. If you choose to disable asynchronous operation replay, each synchronize call will wait for the backend to finish replaying all the current uploaded operation replay records.
When Sybase Unwired Platform does an update operation replay, if the primary key or foreign key of the MBO is generated by the EIS and the MBO has no primary key or foreign key, the Unwired Server loads the primary key or foreign key from the CDB to merge the incoming values with the CDB content so that a full row (graph) can be communicated to the EIS.
oneMBO mbo = new oneMBO(); mbo.setXX(xx); .... mbo.create(); mbo.submitPending(); mbo.setXX(yy); .... mbo.update(); mbo.submitPending(); DBClass.synchronize()
SUP101DB.getSynchronizationProfile().setAsyncReplay(false);
When the application is connected (by Application.startConnection() or Application.registerApplication), it may receive background notifications and trigger a synchronize or other database operation. If you try to delete the database, you may receive database exceptions.
Before deleting the database, stop the application connection (Application.stopConnection()).
public static void beginSynchronize(com.sybase.collections.GenericList<com.sybase.persistence.SynchronizationGroup> sgs,Object context, boolean uploadOnly)
public class MyCallbackHandler extends DefaultCallbackHandler { public int onSynchronize(GenericList<SynchronizationGroup> groups, SynchronizationContext context) { switch(context.getStatus()) { case SynchronizationStatus.ASYNC_REPLAY_UPLOADED: LogMessage("AsyncReplay uploaded"); break; case SynchronizationStatus.ASYNC_REPLAY_COMPLETED: // operation replay finished, return SynchronizationAction.CONTINUE // will start a background synchronization to pull in the results. LogMessage("AsyncReplay Done"); break; default: break; } return SynchronizationAction.CONTINUE; } }