IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Using Batch insert and update service - how to set a "Commit after x rows" rule?

    Posted 06/11/26 03:27 PM

    Hello dears! I hope you're doing well.

    Please, do you know if there's any setting we could configure to commit a batchInsert after, for exemple, 1,000 rows?

    We thought about using a LOOP, checking the $interaction and, when equal to 1000, call the commitTransaction.

    However, is there another way to properly do this?

    Thank you in advance!



    ------------------------------
    Renan Kaic Lopes
    ------------------------------


  • 2.  RE: Using Batch insert and update service - how to set a "Commit after x rows" rule?

    Posted 06/11/26 05:23 PM

    I have seen using a loop and the $iteration variable. Create a Java service to wrap the integer modulo operator (unfortunately, there is no pub.math mod service)

    Assuming your data is in list, very rough pseudocode

    loop over list of listSize {
     add current list item to batchInsertlist
     if ($iteration % 1000 == 0 || $iteration == listSize) {  // current iteration is evenly divisible by 1000 or the final iteration
        batchInsert batchInsertlist  
        commit transaction
      }
    }


    Another idea would be to partition your list into smaller lists using pub.document:groupDocuments loop over the returned documentGroups list. But that could be challenging to get groups of predictable fixed sizes



    ------------------------------
    Dave Laycock
    ------------------------------



  • 3.  RE: Using Batch insert and update service - how to set a "Commit after x rows" rule?

    Posted 06/12/26 08:03 AM

    Dear Dave,

    Thank you very much for your answer.

    After commiting the transaction, should we call the startTransaction again?
    We'll soon implement the way you suggested and let you know the results.



    ------------------------------
    Renan Kaic Lopes
    ------------------------------



  • 4.  RE: Using Batch insert and update service - how to set a "Commit after x rows" rule?

    Posted 06/12/26 10:17 AM

    Bom dia, Renan -

    Out of curiosity: why do you want to do this?

    Do you have a plan for what to do you if one of your groups of transactions fail? For example, let's say you have 5,000 records to be inserted. The first group of 1,000 records get committed successfully, but the second group fails. Will you move on to the next group? Will you abort? And what happens with that first group that was successfully inserted? Doing commits mid-batch may complicate your exception scenarios a bit.

    And the answer to your question is "yes": the startTransaction and commitTransaction go hand-in-hand. If you're going to do commits within the loop, then startTransaction will also need to be in the loop (and perhaps rollbackTransaction as well depending on how you decide to handle exceptions).

    Abs!



    ------------------------------
    Percio
    https://nibl.tech
    ------------------------------



  • 5.  RE: Using Batch insert and update service - how to set a "Commit after x rows" rule?

    Posted 06/12/26 03:55 PM

    Boa tarde, Percio!

    We need to integrate some real data to a datawarehouse staging table. We're going to truncate first the destination table before any insert.
    Our DBA requested us to execute a commit every 1,000 records to not increase resources consumption on the server.
    In case of any error... we're going to stop the interface execution and drop the destination table again, so the B.I system won't load incomplete data and we can check what happened and/or manually execute the interface again.

    We thought about doing it by using U.M and triggers with the "Retry on failure", but I'm not sure if this approach would be the best in the current scenario.

    Abs!



    ------------------------------
    Renan Kaic Lopes
    ------------------------------