Contents Index Adding initial data to your application Writing a synchronization callback function pdf/preface.pdf

UltraLite User's Guide
  Developing UltraLite Applications
    Adding synchronization to your application

Monitoring and canceling synchronization


[ This material is almost all C/C++. It really belongs in a chapter common to the API and ESQL: There is currently no such chapter, so I am putting the C/C++ material here and pointing to the Java material. ]

This section describes how to monitor and cancel synchronization from C/C++ applications. For information on carrying out these tasks in Java, see Monitoring and canceling synchronization.

To monitor and cancel synchronization, you specify a synchronization observer callback function in the ul_synch_info structure. This structure is passed to the synchronization function (embedded SQL) or method (C++ API). The observer function is then called at various points during the synchronization, and supplied with information about the synchronization state.

Monitoring synchronization 

To monitor synchronization from an UltraLite C/C++ application, you supply the name of a callback function in the observer member of your synchronization structure.

The overall process for monitoring synchronization is as follows:

Example 

The following code shows how this sequence of tasks can be implemented in an embedded SQL application:

ULInitSynchInfo( &info );
info.user_name = m_EmpIDStr;
...
//The info parameter of ULSynchronization() contains
// a pointer to the observer function
info.observer = ObserverFunc;
ULSynchronize( &sqlca, &info );

Contents Index Adding initial data to your application Writing a synchronization callback function pdf/preface.pdf