Database replication Is it possible to display the log with the error message

8
Hi All, I am working on Database replication. When I import the data from external database, in the console it displays the FINAL statistics that have the information related to how many rows are Created, Synchronized, Not found, Skipped. But I am unable to identify which row got skipped and what is the reason for this. So is there a possibility to get this information? Please help me out to solve this. It is urgent as we have to answer the client. Thanks, Regards Sushuma
asked
2 answers
1

In the configuration of your mapping you should be able to instruct the module to print the 'not found' messages.

 

In the settings Tab of a mapping you can change the option 'Mode' to advanced to show additional options. This is what they mean:

  • Ignore objects with empty keys;      By default the module will ignore a row if all key attributes are empty, if you uncheck the box the module will stop filtering out empty records
  • Commit unchanged objects;       If all attributes are identical, by default the module will skip the commit action. If the attributes are all identical it isn't necessary to trigger a commit activity. If you check the box the module will always do a commit action on the objects even if nothing has changed.
    Setting the option to false is significantly faster.   If an object remains unchanged it will be counted as  'Skipped'
    Setting the option to true will force a commit on all located objects.    This can be useful if you want to have logic based on for example a changeDate.
    Keep in mind that  this only applies for the primary object that you are importing. If you want to change the behavior for an an associated object you can set the same option through the 'References' tab page.
  • Print not found messages for main object;      This will collect and print the key values of all the objects that cannot be found. Keep in mind that  this only applies for the primary object that you are importing. If you want to lookup an association and print a 'Not Found Message' you can set the same option through the 'References' tab page for each association separately.
    If an object is 'Not Found' it will always be counted as not found, by checking the box the module will collect and print the object keys that can't be found to the standard Mendix log.

I would recommend to leave these on the default value, unless you are experienced in using Mendix transactions I would not recommend this to be changed to anything else.

  • Import in a new context, should be False
  • Use transactions, should be True

 

All messages are printed through the lognodes:

Replication_MetaInfo   -   prints generic info and messages about parsing of specific values
Replication_MetaInfo_MainObject     -     prints (not found) messages specific to your primary import object
Replication_MetaInfo_AssociatedObjects     -     prints all messages specific for all associations

 

 

So to summarize specifically for your scenario.  If you change the Mode to 'Advanced' and check the box 'Print not found messages' after the synchronization the module will print a message very similar to this  (the token |KEY| is used to separate the key values):

Statistics   -   NotFound Objects are listed below: 
 Type: TEST_DbReplication.Order_Import
	- Order 22519|KEY|   Occurences: 1
	- Order 22520|KEY|   Occurences: 1
	- Order 22521|KEY|   Occurences: 1

 

answered
0

Hi Sushuma,

What I can recommend is to load the data in a Mendix table without any validation. If you add a field processing status (either enumeration with different statusses, or a text field) to this table (default _New), you can then start processing the imported data and update each line with the processing result. You can use the field as a filter in an overview form.

Good luck.

Micha Friede

answered