Aborting a transaction

If an error occurs while we are in a transaction, we may wish to abort the transaction, thus rolling back any work that has already been done. This recipe shows how to rollback the currently executing transaction.

Getting ready

In JDeveloper, open the project containing the BPEL process, which may encounter errors, requiring the transaction to be rolled back.

How to do it...

  1. Open the BPEL process that needs to cause the transaction to be rolled back.
  2. From the Component Palette, drag a Throw activity onto the BPEL process:
    How to do it...
  3. Double-click on the Throw activity that was created in the previous step.
  4. Click on the How to do it... icon in the Fault QName section of the dialog to launch the Fault Chooser dialog:
    How to do it...
  5. Select the rollback fault and click on OK:
    How to do it...
  6. Click on OK to apply the changes to the Throw activity.

This activity will cause the current BPEL process transaction to be rolled back when executed.

How it works...

The rollback fault has a special meaning to the BPEL engine and causes the current transaction to be rolled back. The BPEL process will be restored to the state that it was in before the current transaction was started. A rollback fault can't be caught by a BPEL process in the same transaction context.

See also

  • The Catching rollback faults recipe in this chapter
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.137.59