webMethods

webMethods

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.

 View Only
  • 1.  batch insert in database

    Posted Mon March 11, 2013 08:35 AM

    Hi,
    I am using local_transaction in my connection and i want to perform batch insert
    also i am using start,commit,rollback transaction in the service.
    Now the scenario is that while insertion if error occurs it need to be added to log file and other insertions need to be taken place in database.
    For example
    Let us assume 10 records the 6th record has error so the first five and from seventh till tenth i need to be in database so only sixth is not inserted so please let me know how to do it or other ways to achieve it.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: batch insert in database

    Posted Tue March 12, 2013 05:09 AM

    Hi dkm,

    The meaning of batch insert statement is to group a couple of related transactions into a single batch, commit if all statements are valid and roll back if any of the statement get errored. I guess,if your all statements in the batch performs a single transaction then please roll back batch insert and if all went well then commit the whole transaction. If you think they are independent then run those independently as you wish …


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: batch insert in database

    Posted Mon March 18, 2013 11:32 AM

    Hi Dkm,

    First of all the whole batch insert itself is a single transaction. If you want to trace individual transactions, create separate inserts accordingly. To handle errors, create a wrapper which has try catch block. In the catch block dont throw error, instead exit with success(Make sure to track those failed records by writing to file or something).

    My0.02$

    -Niteesh


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB