cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC Adapter: unique constraint

Former Member
0 Kudos

Hi,

my scenario: IDoc -> XI -> JDBC.

I would like to know whether the data processing on my Oracle database was successful or not. If an unique constraint fails on oracle (i have test it)

the idoc has status successful although (XI: SXMB_MONI) . how i can make sure, that my idoc is in error state, if a unique constraint or any other error @oracle occurs ??

Note: JDBC is async

Thanks

Sebastian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

my idoc is an asnyc message, but jdbc sync, i think there is only a sync/async bridge and not an async/sync bridge.

when the idoc goes to the jdbc adapater the state of the idoc is successfully processed. where can i define a "waiting state" for the idoc until the message is successfully processed in the database ?

thx

sebastian

Former Member
0 Kudos

Hi Sebastian,

You can consider using IDOC acknowledgement. It would return the error message that is raised by the JDBC adapter upon constraint failure. This is the plain simple dirty way. For more useful functionality use BPM.

Regards,

Gaurav

Former Member
0 Kudos

sync/async bridge is used when you make a sync call to a async inferface. when you make a async call to a sync interface, no any bridge is needed.

to fullfil your requirement, you could bulid a BPM like this:

1. receive async IDoc

2. mapping IDoc to jdbc documentation format

3. invoke a jdbc sync call

4. check the <b>insert_count</b>, if it dosen't equal zero, that means the data has been successfuly inserted into the database.

5. send a acknowledge Idoc back to the sender system.

btw: the document format of sync response of jdbc adapter

<STATEMENT_response>

<insert_count>count</insert_count>

</STATEMENT_response>

Former Member
0 Kudos

As I know JDBC adapter dose <b>NOT</b> support application acknowledgement. So currently it's impossible to know whether the insert operation has been sucessfully executed or not from jdbc adapter. The only way is to check it manually. Correct me if i am wrong.

> Hi Sebastian,

>

> You can consider using IDOC acknowledgement. It would

> return the error message that is raised by the JDBC

> adapter upon constraint failure. This is the plain

> simple dirty way. For more useful functionality use

> BPM.

>

> Regards,

> Gaurav

Message was edited by:

Hui Wang

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Few options~~

1. Make a Synch Call to the JDBC Insert so that you will get a response back with the Insert_Count etc. Wrap the SEND SYNCHRONOUS step with an Exception handler block of the BPM. If there is an Unique key violation, the Exception handler block of the BPM will be trigered. if everything is succesful, then terminate your BPM with the Send Synch call itself. No other step needed after this.

2.If you do not want to complicate your scenario by using a BPM , I would suggest that you continue with the existing IDOC --> JDBC scenario and you use adapter Engine Alerts of XI's alerts framework to trigger a notification when there is the error in your JDBC adapter.

Regards,

Bhavesh

What you can do is

Answers (2)

Answers (2)

Former Member
0 Kudos

ok, but i dont know the structur of the corresponding output message.

is there a tutorial or anything else oubut jdbc output messages ??

thx

sebastian

moorthy
Active Contributor
0 Kudos

Hi,

This link will help you to understand the document format-

http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

for a sync-

/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step

Regards,

Moorthy

Former Member
0 Kudos

Consider using Sync JDBC (with BPM for example), then you should get number of rows inserted or deleted