Please check my previous post (SOA 11g/12C - BPEL Transaction Handling Part 1)on this topic.
Now we will test other scenario of BPEL transactions
2. Second scenario
Master BPEL Process
bpel.config.transaction=requiresNew
ChildBPEL Process
bpel.config.transaction=required
In this case ChildBPEL process will participate in client's transaction (MasterBPEL process).
| If The ChildBPEL Process | Then The MasterBPEL Process |
|---|---|
Replies with a fault (that is, it uses
<reply>). |
Gets the fault and can catch it. The BPELCaller owns the transaction. Therefore, if it catches it, the transaction is committed. If the BPELCaller does not handle it, a global rollback occurs.
|
Throws a fault (that is, it uses
<throw>). |
Gets the fault and can catch it.
|
Throws (that is, it uses
<throw>) abpelx:rollback fault. |
Gets its transaction rolled back; there is no way to catch it. This fault cannot be handled.
|
We will test last one when ChildBPEL process throws roll back error. In this case transaction in MasterBPEL process will be rolled back even if it catches this exception beacuse both processes are part of same transaction. So, roll back will happen for both the processes.
Transaction settings
MasterBPEL process with CatchAll block
ChildBPEL Process with RollBack exception
Database table with 2 records. We will try to insert third record in this scenario.
Test data on EM
Error on EM console
Audit trail
Employee table - no new record inserted due to global roll back.
In other cases, if ChildBPM process throws error other than rollback and MasterBPEL process catch the exception then MasterBPEL process's transaction will be comitted. You will see new record in database table.
Source:
http://docs.oracle.com/middleware/1213/soasuite/develop-soa/bpel-transaction-semantics.htm#SOASE85818

