Issue:
Learn DB button to keeps trying to learn old doc types
Applies to Software Version: v2.5 & v3.0
When using FuzzyDB in a Batch Class adn recieve the following error:
Error : “Cannot learn DB for a batch class. Invalid object name ‘Index_Field_Name’ error displayed.”
This will cause Learn DB button to keep trying to learn old Doc types.
Reason:
· You have only one document type “Doctype1” set for FuzzyDB, but the batch class dynamic plugin config table showed the traces of previously un-mapped but deleted document types.· There used to be 2 more document types for the provided batch class.
Namely
- ‘Doctype2’
- ‘Doctype3’
The un-mapped leftover config of the document type are causing the trouble.
Solution:
Quick Fix:
1. Delete all such entries from the database. Follow the below instructions for doing that. NOTE: Queries are My SQL specific 2. Get the batch class dynamic plugin config id for those document types. 3. Select batch_class_dynamic_plugin_config.id from batch_class_dynamic_plugin_config where batch_class_dynamic_plugin_config.config_name = ‘document.type’ && batch_class_dynamic_plugin_config.config_desc in ();
Example: e.g. select batch_class_dynamic_plugin_config.id from batch_class_dynamic_plugin_config where batch_class_dynamic_plugin_config.config_name = ‘document.type’ && batch_class_dynamic_plugin_config.config_desc in (‘Doctype2′,’Doctype3’);
e.g. if the query returns “id: 153,163” as result.
4. Delete all the children of these configs. 5. Delete from batch_class_dynamic_plugin_config where batch_class_dynamic_plugin_config.parent_id in ();
Example: e.g. delete from batch_class_dynamic_plugin_config where batch_class_dynamic_plugin_config.parent_id in (153,163);
6. Delete the actual dynamic configs. 7. Delete from batch_class_dynamic_plugin_config where batch_class_dynamic_plugin_config.id in ();
Example: Delete from batch_class_dynamic_plugin_config where batch_class_dynamic_plugin_config.id in (153,163);
Following these steps you can eliminate unnecessary fuzzy mappings.
Permanent Solution (to be added to next Release):
Adding the functionality to remove the Batch class dynamic plugin configs of a document type whenever it is removed. This change will take care of the situation that you don’t have to manually un-map the fuzzy mappings upon a change in the document type.
NOTE: Be sure that whenever you remove/change your fuzzy table outside the application, you also set the mappings accordingly.