Friday, August 23, 2019

BPEL Transaction and Delivery Policies


 BPEL Transaction and Delivery Policies:

Transaction boundaries between different BPEL services are controlled by 2 properties
 1) Delivery Property
 2) Transaction property

Case 1: If BPEL Process is Async or one-way process then, Delivery policy attribute can have three values.
 1) async.persist
 2) async.cache
 3) sync

async.persist: Delivery messages are persisted in the database in table dlv_message of the dehydration store . With this setting, reliability is obtained with some performance impact on the database. When the client initiates a process instance, an invocation request is placed in an internal queue. Inside Oracle BPEL Server, a message-driven bean (MDB), WorkerBean, monitors the queue for invocation requests. When a message is dequeued, Oracle BPEL Server allocates a thread to process the message.

   <component name="AsyncBPELProcess" version="2.0">
    <implementation.bpel src="BPEL/AsyncBPELProcess1.bpel"/>
    <property name="bpel.config.oneWayDeliveryPolicy" type="xs:string" many="false">async.persist</property>
  </component>

async.cache : Incoming delivery messages are stored in the in-memory cache. If performance is preferred over reliability, this setting should be considered. Message are not dehydrated into dlv_message table. Rest all is same as async.persist.

  <component name="AsyncBPELProcess" version="2.0">
    <implementation.bpel src="BPEL/AsyncBPELProcess1.bpel"/>
    <property name="bpel.config.oneWayDeliveryPolicy" type="xs:string" many="false">async.cache</property>
  </component>


sync : The service engine uses the same thread to initiate the message.Directs Oracle BPEL Server to bypass the scheduling of messages in the invoke queue, and invokes the BPEL instance synchronously. In some cases this setting can improve database performance.


  <component name="AsyncBPELProcess" version="2.0">
    <implementation.bpel src="BPEL/AsyncBPELProcess1.bpel"/>
    <property name="bpel.config.oneWayDeliveryPolicy" type="xs:string" many="false">sync</property>
  </component>

Notes:
  1. Transaction property is not supported in oneway/ Async BPEL process.
  2. Specify bpel.config.oneWayDeliveryPolicy in the BPEL process service component section of the composite.xml file. If this value is not set in composite.xml, the value for oneWayDeliveryPolicy in the System MBean Browser in Oracle Enterprise Manager Fusion Middleware Control is used.

Case 2: If BPEL Process is Sync process then, transaction context between client and bpel-process is controlled by "Transaction" Attribute.
Values of these attributes are 
 1) Required 
 2) Requires New

Required :  
In request/response (initiating) environments, this setting joins a caller's transaction (if there is one) or creates a new transaction (if there is no transaction).In one-way, initiating environments, in which the Delivery list value (oneWayDeliveryPolicy property) is set to sync, the invoke message is processed using the same thread in the same transaction.

  <component name="SyncBPELProcess" version="2.0">
    <implementation.bpel src="BPEL/BPELProcess1.bpel"/>
    <property name="bpel.config.transaction" type="xs:string" many="false">required</property>
  </component>

RequiresNew : 
A new transaction is created for the execution, and the existing transaction (if there is one) is suspended. This behavior is true for both request/response (initiating) environments and one-way, initiating environments in which the Delivery list value (oneWayDeliveryPolicy property) is set to sync.

 <component name="SyncBPELProcess" version="2.0">
    <implementation.bpel src="BPEL/BPELProcess1.bpel"/>
    <property name="bpel.config.transaction" type="xs:string" many="false">requiresNew</property>
  </component>


2 comments:

  1. Replies
    1. This is what we need..motivaton. Thank you for visiting the blog. You can also provide your suggestions too.

      Delete

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...