GMU migrateIn issue with JDBC Constraint Violation
search cancel

GMU migrateIn issue with JDBC Constraint Violation

book

Article ID: 105630

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

The GMU migrateIn execution is failing with conflicts. The result.xml file is showing the below error: 

"Constraint Violation: Could not execute JDBC batch update" 

Environment

All supported versions of the CA API Gateway

Cause

It looks like some of the data that is being migrated into the target environment already exists. The conflict errors are due to unique key constraint violations. Below is one example of the error message: 

-------------------------------------  
<l7:Mapping action="NewOrExisting" errorType="UniqueKeyConflict" srcId="ae2ccb59122b8e575db3bb56adf2afc9" srcUri="https://GatewayHostName:8443/restman/1.0/encapsulatedAssertions/ae2ccb59122b8e575db3bb56adf2afc9" type="ENCAPSULATED_ASSERTION"> 
<l7:Properties> 
<l7:Property key="ErrorMessage"> 
<l7:StringValue>(name) must be unique</l7:StringValue> 
</l7:Property> 
</l7:Properties> 
</l7:Mapping> 
-------------------------------------

Or below error could be see in the log

 <l7:Mapping action="NewOrExisting" errorType="InvalidResource" srcId="2aedcac8b1973f382f8cdb3aca99b91f" srcUri="https://GatewayHostName:8443/restman/1.0/policies/2aedcac8b1973f382f8cdb3aca99b91f" type="POLICY">
  <l7:Property key="ErrorMessage">
  <l7:StringValue>Error attempting to save or update the Policy with id = '2aedcac8b1973f382f8cdb3aca99b91f'.  Constraint Violation: Could not execute JDBC batch update    </l7:StringValue>

Resolution

Check destination database to see if the key data already exists.  Need to remove any conflict data and then re-import the migrated data again.