Contents Index Introduction Running .NET synchronization logic

MobiLink Synchronization User's Guide
  Writing Synchronization Scripts in .NET

Setting up .NET synchronization logic


The most important part of implementing synchronization scripts in .NET is telling MobiLink where to find the packages, classes, and methods that are contained in your assemblies. This is described, below.

To implement synchronization scripts in .NET

  1. Create your own class or classes. Write a method for each required synchronization event. These methods must be public.

    For more information about methods, see Methods.

    Each class with non-static methods should have a public constructor. The MobiLink synchronization server automatically instantiates each class the first time a method in that class is called for a connection. The class constructor may have one of two signatures, as described below.

    For more information about constructors, see Constructors.

  2. In the MobiLink system tables in your consolidated database, specify the name of the package, class, and method to call for each script. Optionally, specify the domain. One class is permitted per script version.

    The script_language column of the ml_script system table must contain the word dnet. The string in the script column, which contains a statement for scripts implemented in SQL, must instead contain the qualified name of a public .NET method.

    The easiest way to add this information to the MobiLink system tables is to use the ml_add_dnet_connection_script stored procedure or the ml_add_dnet_table_script stored procedure. You can also add this information using Sybase Central.

    For more information, see ml_add_dnet_connection_script and ml_add_dnet_table_script.

    For example, the following statement, when run in an Adaptive Server Anywhere database, specifies that myNamespace.myClass.myMethod should be run whenever the authenticate_user connection-level event occurs.

    call ml_add_dnet_connection_script( 'version1',
    'authenicate_user', 'myNamespace.myClass.myMethod' )
  3. Create one or more assemblies. You tell MobiLink where to locate these assemblies using options on the dbmlsrv9 command line. There are two options to choose from:


Contents Index Introduction Running .NET synchronization logic