Committing a transaction

We may wish to explicitly commit a transaction in our BPEL process. This recipe describes how to achieve this.

Getting ready

In JDeveloper, open the project containing the BPEL process that you wish to explicitly commit a transaction to.

How to do it...

  1. Add a Dehydrate activity to the process.
  2. Open the BPEL process that needs to explicitly commit the transaction.
  3. From the Component Palette expand the Oracle Extensions section; drag a Dehydrate activity onto the BPEL process:
    How to do it...

When executed, this will cause the current transaction to be committed and a new transaction to be started.

How it works...

The Dehydrate activity causes the current state of the BPEL process to be saved in the dehydration database. This also causes the current transaction context to be committed. Because the BPEL process is still active, a new transaction context is immediately created.

There's more...

A Dehydrate activity can be very useful in an asynchronous process, but should be avoided in a synchronous process unless the BPEL process's bpel.config.transaction property is not set or set to requiresNew.

Note

Synchronous BPEL processes that have the required transaction attribute should always leave the committing of the transaction to the caller; they should never force the committing of a transaction.

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.135.196.103