MongoDB V2 Connector > Mappings for MongoDB V2 > Stop on errors
  

Stop on errors

You can configure the maximum number of load job errors at the target that a mapping task can encounter before it stops. You can also capture the rejected rows in an error file.
The error threshold can include malformed rows and data conversion errors in the load job, but the errors resulting from update, delete, or merge queries are excluded.
You can set the error threshold value in the Stop on errors session property in a mapping task. You can set the value from 0 to 2147483647. Values less than 0, alphabets, and special characters are not allowed.
When you run a mapping task with bulk operations on the target, such as delete or load data, the mapping task executes operations in parallel instead of in sequence.
The following examples describe the mapping task behavior based on the error threshold you set:
You can't configure the stop on error functionality in mapping tasks that are based on mappings in advanced mode.

Capture rejected rows in an error file

When you write data to a MongoDB V2 target in a mapping task configured with an error threshold, you can capture the rejected rows in an error file.
Use the error file to understand why the Secure Agent didn't write data to the MongoDB V2 target.
The Secure Agent writes rejected rows to the error file for all target operations and for tasks that capture changed data.
    1Create a mapping task that uses the configured MongoDB V2 mapping.
    2On the Runtime Optionstab, go to theAdvanced Session Properties section.
    3From the Session Property Name list, add the following properties, and then set the values:
    1. aSelect the Error Log Type property and set the value to Flat File.
    2. bSelect the Error Log File Directory property and enter a directory for the error file.
    3. If you don't configure this property, the Secure Agent generates the error file in the following default directory:
      <Secure Agent installation directory>/apps/Data_Integration_Server/data/error
      To change the default directory, see the Change the default error file directory in the Secure Agent Knowledge article.
    4. cSelect the Error Log File Name property, and enter a file name with the .bad extension for the error file.
    5. The configured advanced session properties in a mapping task for generating an error file.
      If you don't configure this property, the Secure Agent names the error file in the following format:
      <Mapping task ID>_error.csv
    4Click Save > Run to run the mapping task.

Rules and guidelines for generating error file

Consider the following rules and guidelines when you generate an error file for the rejected rows in a mapping task: