Contents Index Writing Java synchronization logic Transactions

MobiLink Synchronization User's Guide
  Writing Synchronization Scripts in Java
    Writing Java synchronization logic

Class instances


The MobiLink synchronization server instantiates your classes at the connection level. When an event is reached for which you have written a non-static Java method, the MobiLink synchronization server automatically constructs the class, if it has not already done so on the present connection. To do so, it uses the class constructor.

For each database connection, once a class has been instantiated, the class persists until that connection is closed. Thus, the same instance may well be used for multiple consecutive synchronization sessions. Information present in public or private variables will thus persist across synchronizations that occur on the same connection unless explicitly cleared.

You can also use static classes or variables. In this case, the values are available across all connections.

The MobiLink synchronization server automatically deletes your class instances only when the connection to the consolidated database is closed.

All methods in one script version called on the same connection must belong to the same class .


Contents Index Writing Java synchronization logic Transactions