Saturday 2 September 2017

BPEL Transaction and Delivery Policies

Background

Transaction context between different BPEL services are controlled by mainly two properties/attributes.  Those are Delivery and Transaction attributes.  Also refer my other post for additional details : "Transaction Management in Oracle SOA (BPEL)"

Details

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

meaning:
- async.persit: Delivery messages are persisted in the database in table dlv_message. 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="BPELASynchCall" version="2.0">
    <implementation.bpel src="BPELASynchCall.bpel"/>
    <property name="bpel.config.transaction" type="xs:string" many="false">required</property>
    <property name="bpel.config.oneWayDeliveryPolicy" type="xs:string"
              many="false">async.persist</property>
  </component>

- async.cache : Incoming delivery messages are kept only 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="BPELASynchCall" version="2.0">
    <implementation.bpel src="BPELASynchCall.bpel"/>
    <property name="bpel.config.transaction" type="xs:string" many="false">required</property>
    <property name="bpel.config.oneWayDeliveryPolicy" type="xs:string"
              many="false">async.cache</property>
  </component>

- sync : 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. So there is no role of invoke queue and worker bean here.

  <component name="BPELTest" version="1.1">
    <implementation.bpel src="BPELTest.bpel"/>
    <property name="bpel.config.transaction" type="xs:string" many="false">required</property>
    <property name="bpel.config.oneWayDeliveryPolicy" type="xs:string"
              many="false">sync</property>
  </component>

case2: 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

meaning:
- Required : This makes the BPEL process execute as part of the calling transaction. If no calling transaction exists, it will create a new one.

bpel.config.transaction property is set to requiresNew:
<component name="BPELProcess2" version="1.1">
    <implementation.bpel src="BPELProcess2.bpel"/>
    <property name="bpel.config.transaction" many="false" type="xs:string">required</property>
</component>

- RequiresNew : This is the default value and makes the BPEL process execute as a separate transaction. Any existing transaction will be suspended.

bpel.config.transaction property is set to requiresNew:
<component name="BPELProcess2" version="1.1">
     <implementation.bpel src="BPELProcess2.bpel"/>
     <property name="bpel.config.transaction" many="false" type="xs:string">requiresNew</property>
</component>

No comments:

Post a Comment