Using JTA Begin and End in Process Flow

This example shows how to use the JTA Begin and End block to do database rollback if DB Target activity throws Sql exceptions while loading the data into the database. Also it shows how to change the status of the flow to Abort.

  1. Put the JTA Begin and End as shown in the flow diagram. Double click on the DB Target activity and in the Properties Panel make the Error Level to 'File'. By using this option you can find the errors in the process flow logs Repository.
  2. Make the jtaEnlist to True. This will allow database rollback in case of any errors.
  3. Now right-click on the DB Target Activity and select "Invalid Data Exception Dialog" option. There paste the following statement >> service.setRollbackOnly();
  4. This will change the status of the process to "Abort" in case of any errors in the target activity.
  5. Process Flow logging level can be set to "Error" (which is default).

You can use the above approach in any flow.





Have more questions? Submit a request


Article is closed for comments.