When you develop an application that uses merge replication, there are several differences between the Replication objects in native and managed code. The primary difference between the two platforms is support for asynchronous synchronization.

Synchronization Methods

In native code, synchronization occurs on a single thread. To report synchronization status in your application, you implement the ISyncStatusReport interface and its methods. In managed code, however, synchronization can occur on multiple threads, and the Microsoft .NET Compact Framework handles much of the asynchronous behavior. As the application developer, you choose whether or not to use the synchronization status reporting.

The other primary change to note between Replication methods are the three methods used to perform synchronization in native code: Initialize, Run, and Terminate. In managed code, these three functions are all incorporated in a single Synchronize method.

The following table shows the mapping between Replication methods in native and managed code:

Native (Visual C++ for Devices) Method

Managed (.NET) Method

Initialize

Synchronize

Run

Synchronize

Terminate

Synchronize

Cancel

CancelSynchronize

n/a

BeginSynchronize

n/a

EndSynchronize

n/a

LoadProperties

n/a

SaveProperties

The Synchronize method in managed code performs all of the functions of the Initialize, Run, and Terminate methods in native code.