I am little new to WM and trying to develop few services. I have a for loop in which i am calling JDBC adapter service which inserts the record in DB but if there is anything wrong in insert statement then the whole service boms out instead i want to use try catch block along with continue statement. I mean if there is any exception it should keep inserting remaing records.
Please help me to understand how best i can do this.
Thanks for the reply. I will try our your solution today. One thing which i want to ask here is will it insert remaining records in DB if there is any exception in JDBC service for say any record?
The reason i am asking you this is i don’t see any continue statement in this praposed solution.
There is no continue statement in flow.
What you want to do is in case of any exception in loop, catch it in (child) catch block but do not roll back or throw exception, in this case it will continue to next record.
In case of any exception outside your loop, it will be caught in final (parent) catch block, there you can roll back transaction and commit in the last step of your (parent) try block.