cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC receiver, continue processing after an error

0 Kudos

I have SOAP to JDBC async scenario.

One source message has multiple line items, each line item converted to separate record and inserted in database table (Using graphical mapping and INSERT command). Receiver database table has composite unique primary key constraint. Due to this, in case of any duplicate record, whole message gets error out in receiver communication channel.

Is there any way, in case of any error due to 'Primary key violation', just ignore that record and continue with next record to insert in database.

View Entire Topic
RaghuVamseedhar
Active Contributor
0 Kudos

Hi Anand More,

For this issue, I do not think you can do something in PI to avoid it. But you can do some changes in Database to solve the issue.

sapnote_0000831162 [Link1|https://websmp206.sap-ag.de/notes] Q: When I construct payload using UPDATE_INSERT, I get Cannot insert duplicate key in object XXX. How do I resolve this?

A: You need to create UNIQUE INDEX for the table with 'IGNORE_DUP_KEY' option.

For instance, if the table name is TEST and its primary key is id, then following statement may be executed using Query analyzer tool.

CREATE UNIQUE INDEX TEST_INDEX ON TEST(id) WITH IGNORE_DUP_KEY

After executing the above command, please re-run the scenario.

Regards,

Raghu_Vamsee

0 Kudos

Hi Raghu, Thank you for reply.

Unique key constraint for the database table is business requirement. We dont want to insert duplicate records in table. For this purpose we need to ignore duplicate records.

Anand.