cancel
Showing results for 
Search instead for 
Did you mean: 

How to reprocess in case of failure of multiple table JDBC Insert

0 Kudos

Hi All,

I have a scenario where I am inserting 5 table with the single inteface.

MT_Rever

--Stat1TableInsert

--Stat2TableInsert

--Stat3TableInsert

--Stat4TableInsert

--Stat5TableInsert

How do we reprocess the message when first 3 table inserted successfully but failed while inserting into 4th table. What should be approach to reprocess this?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member190293
Active Contributor
0 Kudos

Hi Vinay!

You could try this:

Regards, Evgeniy.

0 Kudos

Hi Evgeniy,

Thanks for your response. I do agree with you, but I am seeing that if there is some data issue in the 3rd or 4th Insert, all the messages above getting inserted into table before it error out. Is there any setting in the adapter which prevent data to commit in database? I have DB2 as receiver database.

Thanks

Vinay

former_member190293
Active Contributor
0 Kudos

Hi Vinay!

As far as I know, all statements within one message are processed in single transaction by JDBC adapter. So, if your fourth insert is failed by any reason, transaction in the whole won't be commited.

Regards, Evgeniy.

manoj_khavatkopp
Active Contributor

Vinay ,

Just adding to Eve's suggestion if you are doing insert operation in one table only then its not a good idea of repeating the statment multiple times instead of the create one statement with multiple access node by this a single SQL query is executed on DB with multiple values like :

INSERTINTO MyTable ( Column1, Column2 )VALUES( Value1, Value2 ),( Value1, Value2 )

Br,

Manoj

former_member190293
Active Contributor
0 Kudos

Hi Manoj!

Yes, you're absolutely right. But I guess that insert opertaion is performed upon 5 tables sequentially.

How do we reprocess the message when first 3 table inserted successfully but failed while inserting into 4th table

Regards, Evgeniy.