cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC to JDBC scenario

Former Member
0 Kudos

Hi All,

I have one scenario in which I have to select data from one database (say D1) & insert into another database (say D2). Based on success or failure of insertion, I have to update the status message back in Sender database (D1).

Now, when message is inserted in D2, I get back the insert count but if msg doesnt get inserted due to erros like invalid data record, i wont be getting any response, instead my receiver adapter will throw any exception.

I need to use BPM to configure this scenario but I am not getting how to capture the exceptions here or How to achieve the success or failure of receiver insertion in XI.

Any help is highly appreciated.

PS: I have mapped my source records with access of Receiver structure so if error occurs , it will be a case of All or None insertion.

Regards

Sushil

Accepted Solutions (0)

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Sushil,

1. You can make a Synchronous Call to the Receiver JDBC adapter that will return you the status of the Insertions. This will be the number of Succssful Inserts.

Using this you can decide whether all were successful and then either trigger the update to the Sender to update all records with the correspodning flag.

The Send STep that makes the call for the Insertion in the BPM will be a Synch Send Step . You can also wrap this with a Exception handler of the BPM and this will also trigger the exception handler where you can call the error mapping and so on.

Look into the Document Formats of the JDBC adapter in the online help for more on the Sync Insert call that returns the number of inserts.

Regards

Bhavesh

Former Member
0 Kudos

Yes Bhavesh,

I need to use Synch JDBC call for receiver but when there is some error like duplicate insertion or any invalid field value then XI receiver adapter will throw error & in this case I wont be getting any response from Receiver. Also we need to define exceptions in BPM. In this case which type of exception will I define..??

Can you please throw more light on handling exception part in above mentioned cases..??

Regards

Sushil

bhavesh_kantilal
Active Contributor
0 Kudos

Sushil,

Wrap your Send Synch Step around a Block.

This block will have a exception handler.

In the send synch step's properties you can call this Exception Handler when a Error occurs.

In the exception handler , you hcan have the mapping that sets the Error Flag and then makes the Call to the Receiver JDBC adapter to update the Source Table with the Error Flag

Look into the SAP basis Component --> and the Patterns Namespcae for examples on the exception handler.

Regards

Bhavesh

Former Member
0 Kudos

I look into examples but didnt get any. (I m using PI 7).

I m still confused with exceptions handling as if I m not wrong then we need to define exceptions like time out etc to handle them but in this case when receiver JDBC adapter will throw error how to catch it n handle it.

Is there any way in which I can do processing for only successful case or Else which will be able to handle all cases (Just like IF ELSE of ABAP or others in CASE ENDCASE but here I wont be getting any response from receiver..!!)

Regards

Sushil

bhavesh_kantilal
Active Contributor
0 Kudos

Sushil,

That is what the exception handler does.

It is like Try - Catch In Java .

When the JDBC adapter errors out, the Exception Handler branch is triggered.

http://help.sap.com/saphelp_nw70/helpdata/en/33/4a773f12f14a18e10000000a114084/content.htm

You need to try a sample scenario to understand exception handlers of BPM.

Regards

Bhavesh

Former Member
0 Kudos

Ok I will try as mentioned by you & hope will be able to achieve scenario.

Thanks for your help.

Regards

Sushil