Skip to Content
avatar image
Former Member

Putting a Delay After Splitting a Message Payload

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


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 26, 2013 at 12:38 PM

    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 LevelDatabase ‘Auto-Commit’ Enabled (No Transaction Handling)

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

    Hope it helps!

    Ambrish

    Add comment
    10|10000 characters needed characters exceeded

    • 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 😊

  • avatar image
    Former Member
    Jul 29, 2013 at 04:17 AM

    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

    Add comment
    10|10000 characters needed characters exceeded