Dehydration In SOA
Why Dehydration
Dehydration
– Using Dehydrate activity we can explicitly dehydrate process state if required.
Dehydrate Activities
Dehydrate(11g) / Checkpoint(10g)
Receive(without create instance)
Commit(Java embedded)
Pick
Invoke(nonBlocking property set on PL)
Non-idempotent activity(Invoke, receive) is encountered.
Types of BPEL Process
When and how dehydration occurs differ based on process types. Based on the dehydration we can categorize process in to 2 categories
That is where an existing BPEL instance must wait for an event, which can be either a timer expiration or message arrival. When the event occurs (the alarm expires or the message arrives), the instance is loaded from the dehydration store and execution is resumed. This type of dehydration occurs only in durable processes, which have mid-process breakpoint activities. A transient process does not have any mid process breakpoint activities.
Idempotent activities are those activities where the result is the same irrespective of no. of times you execute the process.
Repeated invocations have the same effect as one invocation.
E.g. Read only services, Receive activity
Note: A BPEL invoke activity is by default (true) an idempotent activity, meaning that the BPEL process does not dehydrate instances immediately after invoke activities. Therefore, if idempotent is set to true and Oracle BPEL Server fails right after an invoke activity executes, Oracle BPEL Server performs the invoke again after restarting. This is because no record exists that the invoke activity has executed. This property is applicable to both durable and transient processes. If idempotent is set to false, the invoke activity is dehydrated immediately after execution and recorded in the dehydration store. If Oracle BPEL Server then fails and is restarted, the invoke activity is not repeated, because Oracle BPEL Process Manager sees that the invoke already executed.
Skipping dehydration
- Long running process or processes waiting for response consumes memory and CPU
- While waiting for the response the bpel engine can store the process, thus freeing up server resources.
- Over the life cycle of the BPEL instance, the instance with the current state of execution may be saved in database.
Dehydration
- Storing the current status of the BPEL process(i.e. long running process, asynchronous process) into the database tables is known as dehydration
- SOA_INFRA schema is the dehydration store which contains tables to hold the meta data of the process.
- Synchronous Process
– Using Dehydrate activity we can explicitly dehydrate process state if required.
- Asynchronous Process
Dehydrate Activities
- Few activities causes the BPEL instances to be dehydrated
- If the process is dehydrated, then transaction ends and a new transaction is started once the bpel process resumes.
- Dehydration activities:
Dehydrate(11g) / Checkpoint(10g)
Receive(without create instance)
Commit(Java embedded)
Pick
Invoke(nonBlocking property set on PL)
Non-idempotent activity(Invoke, receive) is encountered.
Types of BPEL Process
When and how dehydration occurs differ based on process types. Based on the dehydration we can categorize process in to 2 categories
- Transient Process: Oracle BPEL server dehydrates the process instance only at the end of the process. If server crashes in middle of the running process instance, the instances will not be visible in EM
- Durable Process: Oracle BPEL Server dehydrates the process instance in-flight at all midprocess breakpoint and non-idempotent activities, plus the end of the process. When the server crashes, this process instance appears in Oracle BPEL Control up to the last dehydration point (breakpoint activity) once the server restarts. If the server crashes before the process instance reaches the first midprocess breakpoint activity, the instance is not visible in Oracle BPEL Control after the server restarts.
- When the BPEL instance encounters a mid-process breakpoint activity (not including the initial receive).
That is where an existing BPEL instance must wait for an event, which can be either a timer expiration or message arrival. When the event occurs (the alarm expires or the message arrives), the instance is loaded from the dehydration store and execution is resumed. This type of dehydration occurs only in durable processes, which have mid-process breakpoint activities. A transient process does not have any mid process breakpoint activities.
- When the BPEL instance encounters a non-idempotent activity
Idempotent activities are those activities where the result is the same irrespective of no. of times you execute the process.
Repeated invocations have the same effect as one invocation.
E.g. Read only services, Receive activity
- When the BPEL instance finishes
Note: A BPEL invoke activity is by default (true) an idempotent activity, meaning that the BPEL process does not dehydrate instances immediately after invoke activities. Therefore, if idempotent is set to true and Oracle BPEL Server fails right after an invoke activity executes, Oracle BPEL Server performs the invoke again after restarting. This is because no record exists that the invoke activity has executed. This property is applicable to both durable and transient processes. If idempotent is set to false, the invoke activity is dehydrated immediately after execution and recorded in the dehydration store. If Oracle BPEL Server then fails and is restarted, the invoke activity is not repeated, because Oracle BPEL Process Manager sees that the invoke already executed.
Skipping dehydration
- Skipping dehydration will increase performance with a cost of auditing.
- By Default, all BPEL processes are dehydrated regardless of whether they are Synchronous or Asynchronous process.
-
For Synchronous processes that do not need to be durable, you can turn off the dehydration mechanism by setting the following properties at process or engine level:
- Set inMemoryOptimization to true.
- Set completionPersistPolicy property to faulted or Off.
- Asynchronous process invocation messages are always saved to the dehydration store.
- Durable process are always dehydrated regardless of the settings of the persistence properties.
- Cube_Instance: Stores the information about the composite instance that gets created.
- Cube_scope: Stores information about the scopes and variables declared and used.
- DLV_Message: All the incoming payload details are stored.
- Invoke_Message: All the outgoing message payload details are stored.
- Audit_Trail: Used to store information of the xml that is rendered in EM console.
No comments:
Post a Comment