Thursday, July 22, 2010

BPEL Performance – Tips & Tricks – 1

Dehydration Tuning

Dehydration tuning is required during CPU and Memory heavily utilized.

BPEL stores all the instances in the dehydration store during mid-point activities (onMessage, Receive, wait, onAlarm) also stores the instances during end of transaction.

1. auditLevel

Audit trial logging level is a domain level setup can be configured in BPEL console. Below settings controls the amount of audit events logged by a process. Audit trial is set to all types of processes.
  • off - absolutely no logging performed whatsoever; may result in a slight performance boost for processing instances.
  • minimal - all events are logged; however, no audit details are logged.
  • production - all events are logged. The audit details for assign activities are not logged; the details for all other nodes are logged.
  • development - all events are logged; all audit details for all activities are logged.
2. completionPersistPolicy

This setup can be done in both process and domain level. This configuration are done in Transient or short living processes. This setting will decide whether and when to save the instance.

This property controls if and when to persist instances. If an instance is not saved, it does not appear in Oracle BPEL Control. This property is applicable to transient BPEL processes.

This property is only used when inMemoryOptimization is set to true for transient bpel process.
This property has the following values:
  • on : (default): Completed instances are saved normally.
  • deferred : Completed instances are saved with a different thread and in another transaction. If a server fails, some instances may not be saved.
  • faulted : Only faulted instances are saved.
  • off : No instances (and their data) are saved.
3. completionPersistLevel

This property can be configured in both process and domain level. This configuration is done in transient or short living processes. This setting will control the amount of instance state saved to database.

This property is used only when the inMemoryOptimization performance property is set to true for transient bpel process. Use the completionPersistLevel property in conjunction with the completionPersistPolicy property.

This property has the following values:
  • all (default) : Oracle BPEL Server saves the complete instance, including the final variable values, work item data, and audit data. This setting causes the database to grow in size.
  • instanceHeader : The Oracle BPEL Process Manager saves only the instance metadata.
Process Level Dehydration Tuning

<BPELSuitcase>
<BPELProcess id="CreditRatingService“ src="CreditRatingService.bpel">
<partnerLinkBindings>
<partnerLinkBinding name="client">
<property name="wsdlLocation">CreditRating.wsdl</property>
</partnerLinkBinding>
</partnerLinkBindings>
<configurations>
<property name="inMemoryOptimization">true</property>
<property name="completionPersistPolicy">faulted</property>
<property name="completionPersistLevel">all</property>
</configurations>
</BPELProcess>
</BPELSuitcase>

Friday, July 16, 2010

BPEL Best Practices

-Use Assign activity instead of Transform Activity where ever possible since it take less memory.

–Do not import or add XSD files in a ZIP file into a BPEL project. Always extract the XSD files from a ZIP file before importing them.

–Do not include any special characters in the project name (such as periods). If you do include special characters, errors appear when you attempt to compile your project

–The bpel.xml file content is only read into memory when the file is opened. Therefore, if you change the content of bpel.xml after the file is opened, the changes are not made in memory. After changing the content of the BPEL file, close and reopen the file for the changes to take effect.

–Do not edit the bpel.xml file through a combination of Oracle JDeveloper and a text editor such as Notepad or Wordpad. Use only a single editing environment such as Oracle JDeveloper.

–Do not edit the bpel.xml file, BPEL files, and WSDL files while changing the
design of the process. If you want to edit a file:
1. Ensure that the BPEL files are not being edited in Oracle JDeveloper. If they are being edited (that is, a tab for that file is visible), close it and save changes as needed.
2. Edit the required file and save the changes

–Oracle BPEL Process Manager does not support SOAP-encoded arrays.(soapenc:arrayType).
Use one of the following workarounds:
* Apache Axis supports document-literal style services. This means you can change the service to not use soapenc:arrayType.
* A wrapper can be placed around the service (also using Apache Axis) so that the BPEL process talks to the document literal wrapper service, which in turn calls the underlying service with soapenc:arrayType.
* Call a service with soapenc:arrayType from BPEL, but construct the XML message more manually in the BPEL code. This enables you to avoid changing or wrapping the service. However, each time you want to call that service from BPEL, you must take extra steps

–If you use large binary attachment files in SOAP messages with Oracle Database Lite, your BPEL process may not complete processing, which can cause you to run out of system memory. Oracle Database Lite is largely for testing purposes. To use large binary attachment files in SOAP messages, use an Oracle Database as your dehydration store

–Use TCP tunneling to view SOAP messages exchanged between the BPEL process flow and the Web service (including those containing the
correlation ID). You can see the exact SOAP messages that are sent to, or received from, services with which a BPEL process flow communicates.

–Instead of manually entering an expression, you can press Ctrl and then the space bar in the Expression field. Scroll through the list of values that appears and double-click the value you want. Edit the value as necessary. As you enter information, a trailing slash can appear. This means you are being prompted for additional information. Either enter additional information, or press the Esc key and delete the trailing slash to complete the input of information.

–Do not copy and paste the expression syntax shown in this document into Oracle JDeveloper. This is because the single and double quotation marks are sometimes not compatible with Oracle JDeveloper. Instead, use the Expression Builder window or press Ctrl and then the space bar to use the XPath Building Assistant.

–When you deploy a process with the same name and version, you are prompted to overwrite the currently-deployed BPEL process or deploy to a new version number. The best practice is to always deploy to a new version (as described in this tutorial). Redeploying a process with the same version can have consequences, such as instances being marked as stale.