cancel
Showing results for 
Search instead for 
Did you mean: 

Putting a Delay After Splitting a Message Payload

Former Member
0 Kudos

Hello Respected Sirs,

I am working on a Proxy to JDBC Interface in which PI Sometimes recieves a payload containing Multiple Line Items which PI splits into Single messages  with single line items which are being send to SQL Server. Now for example When PI is receiving a Payload containing  5 line items it sends 5 Single Messages each Contains a single Line item. But the Problem happens with the fact that PI sends all the 5 messages at the exact same time exact to the same second. Due to which the SQL Server fails to store all the 5 Line items as it receives all at the exact same instance of time.

I would be very grateful if someone can please tell or give me some idea about how can i put a delay of at least 100ms  between the sending of each split messages after splitting a payload of multiple line items

Thank you all


Accepted Solutions (1)

Accepted Solutions (1)

ambrish_mishra
Active Contributor
0 Kudos

Hi Promit,

What happens when the line items are sent at the same time. Locking ?

Which database are you writing to?

You can induce the wait by a simple Java code when you split the nodes into multiple.

try {
   
Thread.sleep(100);
} catch(InterruptedException ex) {
   
Thread.currentThread().interrupt();
}

However it is not an ideal solution.

You should be handling this situation through the options available in JDBC adapter.

There are 2 options relevant to your problem.

Go through the link below and read more about the 2 parameters mentioned.

http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm

Database Transaction Level
Database ‘Auto-Commit’ Enabled (No Transaction Handling)

I think you should be able to resolve this using these 2.

Hope it helps!

Ambrish

Former Member
0 Kudos

Thank you Sir for Replying,

The interface writes to MS SQL Server 2008, When the database recieves more than 1 record at the exact same time the trigger fails to update all of them.

I am Splitting the Payload into multiple line items using mapping

Please find the Snapshot below

where exactly would i put the java code .Do i need to create a custom node for this.

i would try putting in Auto Commit as enabled and test right away

ambrish_mishra
Active Contributor
0 Kudos

Hi Promit,

Please try the adapter options first...this is standard and should work in MS SQL server.

Just for your knowledge, you can put the code in Statement node mapping. We can explore that later.

cheers,

Ambrish

PS: Call me Ambrish

Answers (1)

Answers (1)

praveen_sutra
Active Contributor
0 Kudos

Hi Promit,

1)Increase max concurrencey value to 4.

2)create only 2 JDBC receiver channels and use one for Async scenarios and one for Sync scenarios.

3)Set poolwait time 90000 .

thanks and regards,

Praveen T