DB replication process

1
Please any one explain the DB replicaion process...I have connected to my mssql server and able to map the tables in the db replication module but i am not getting how it is integrated to my app and will display the data
asked
1 answers
3

The module allows you to setup a mapping to pull data from an external database into your entities. How and when this happens needs to be developed by you.

The first step is to setup the different table mappings, once you have those you can start the development. There are two main variations that you can use to use the module:

Through a scheduled event, which imports all the tables every night:

  1. ScheduledEvent: Built your own microflow that retrieves all table mapping entities, and for each calls the java to start the import.
  2. Schedule all imports: Follow the appstore documentation and setup an 'ImportCall' (second tab page), and a '

    Planned import action', this will basically allow you to graphically built the sequence and rollback behavior of the import mappings.
    This does the same thing as option 1, but this already has a import sequence built-in and has error handling setup. I would recommend this over building your own scheduled event. 

 

Alternatively you can also do a 'live' import from a datasource microflow. If you use this option make sure you use small sets of data, don't import thousands of records since your application becomes increadibly slow. I've done this myself and was retrieving a few dozen records based on user input and present that in a grid. To built this:

  • Create your table mapping
  • Setup and 'importcall' record,    we need this so we can associate the imported data to the entity from your dataview
    • in the import call you'll configure 'data object 1', this allows you to chose an association between your dataview and imported records
  • Create a page with a dataview, and datagrid. Your datagrid has a datasource MF, with the dataview as input
  • In the microflow retrieve the ImportCall configuration that you want to use
  • Call the Java 'ImportByImportCall', pass in the import call record, and your dataview entity via the parameter 'DataObject1'
  • after the import, retrieve via association the records that would have been imported
  • let the microlfow return the retrieved list
  • Also:  remember to put error handling on the Java action, and nicer user feedback if your db isn't accessible

The scenario above also works for both persistent and non-persistent entities

answered