Saturday, January 3, 2015

Oracle SOA 11g/12C - BPEL Transaction Handling Part 2


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 ProcessThen 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

2 comments:

  1. Hello Sonu,

    I have read both part of this blogpost.
    However I have one problem.
    This last scenario you are telling it does not write in the Database.
    But when I ran it did.

    Are you using XA datasource for the last scenario or non XA?
    Because with non XA it will write in the DB..but for XA it rolls back.

    Please help.

    I have asked the same in
    https://oraclesoaosbbpmapi.blogspot.com/2017/09/oracle-soa-transaction-management-and.html?showComment=1574948164274#c218876092527365068
    blog too.

    Thanks!!

    ReplyDelete
  2. I wish to show thanks to you just for bailing me out of this particular trouble. As a result of checking through the net and meeting techniques that were not productive, Same as your blog I found another one Oracle OSB 12c.Actually I was looking for the same information on internet for Oracle OSB 12c and came across your blog. I am impressed by the information that you have on this blog. Thanks once more for all the details.

    ReplyDelete