Assets import through database bulk import is failing in ITPAM
search cancel

Assets import through database bulk import is failing in ITPAM

book

Article ID: 387662

calendar_today

Updated On:

Products

CA Process Automation Base

Issue/Introduction

We attempted to use the bulk import functionality, because currently we work with the insert operator - but this is very slow
for 744 insert over 7 minutes.

The bulk import method generates error code=3 during execution and the c2o log shows:
 
[com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Could not commit transaction.

Environment

Release: 4.3.5+

Components: CA Process Automation Base

Cause

The root cause of the issue related to the syntax of the command used for the bulk import. The JSON script format should begin with a single quote for string value and with another single quote, as demonstrated in the resolution section below.

Resolution

The requirement to verify that single quotes encapsulate any string values, must be met.

Incorrectly formatted JSON's string values: 

Process.hp_asset.length= Process.hp_asset.length + Process[OpName].response.devices.length;

for (i=0; i<Process[OpName].response.devices.length; i++)
{
  Process.hp_asset[Process.hp_asset_count].productNumber = Process[OpName].response.devices[i].productNumber;
  Process.hp_asset[Process.hp_asset_count].serialNumber    = Process[OpName].response.devices[i].serialNumber;
  Process.hp_asset_count++;

}


Correct encapsulation of the string value mapping in JSON:

Process[OpName].response = convertJson(Process.Read_from_File.DatasetVariable[0]);

Process.hp_asset.length= Process.hp_asset.length + Process[OpName].response.devices.length;

for (i=0; i<Process[OpName].response.devices.length; i++)
{
  Process.hp_asset[Process.hp_asset_count].productNumber = "'"+Process[OpName].response.devices[i].productNumber+"'";
  Process.hp_asset[Process.hp_asset_count].serialNumber    = "'"+Process[OpName].response.devices[i].serialNumber+"'";
  Process.hp_asset_count++;
}