cancel
Showing results for 
Search instead for 
Did you mean: 

Even if Mapping fails JDBC sender updating the table

siddhesh_pathak4
Contributor
0 Kudos

Hello all,

I have one scenario (JDBC to PI to IDOC). I am writing the SELECT and UPDATE in sender channel itself.

My issue is, when mapping is failing due to some reason the database is still getting updated. How can i avoid this UPDATE.

Thanks for all your help in advance.

Thanks,

Siddhesh

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Update statement works when sender CC start working , so you can control this update statement, you have to write logic in mapping when mapping fails then change the key field value in Data base table.

but you have to be very carefull here.

Regards,

Raj

siddhesh_pathak4
Contributor
0 Kudos

Hey Raj,

Thanks for quick response. but could you please elaborate moer on this? I did not understand how i will be able to modify the UPDATE Statement if mapping fails. because i have written the update in CC.

Thanks,

Siddhesh

rajasekhar_reddy14
Active Contributor
0 Kudos

You have to write UDF in mapping level to update/change the the status of the field when everything goes fine.

Regards,

Raj

Former Member
0 Kudos

Hi Siddhesh,

I can think of one more solution which is slightly complex. You can do something like this -

1) On sender side - In JDBC sender channel, keep only SELECT command, and remove the UPDATE command.

2) On receiver side - In addition to the exisitng receiver (where you are sending IDocs), add one more reciever which is the sending system itself. Use JDBC receiver channel and the standard XML structure in which you can specify only the UPDATE command involving fields that you want to update in database.

3) Mappings section - You will need to create one new message mapping and interface mapping accordingly. In this interface mapping, plug in two message mappings in sequence as -

a) JDBC to IDoc mapping (which you must have already used for the first receiver)

b) JDBC to JDBC mapping.

So if the first mapping fails, the second will not get executed. Hope this helps.

Regards,

-Shankar

siddhesh_pathak4
Contributor
0 Kudos

Hello Shakar,

Thanks for the response. I thinking of same solution too. But littile bit confused about creation of operation mappings. I will try this solution now.

Guys closing this thread. Thanks all again.

Thanks,

Siddhesh Pathak

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Commit operation to database happends immediately after the channel picks the data and send to integration engine...

it will not take care of the mapping status ...

you need to resend the data from the Integration engine either or change the database stauts (not recommended but an oprtion..)

if you want to have the commit only after the operation has been finished..option can be to change the interface to synchronous or get the response from the target system with an id..of a table and based on this update the table in database...

HTH

Rajesh