Sunday, December 30, 2012

OFM 10.3.6: Java code to view the contents of a Java Key Store (JKS)

OFM 10.3.6: Java code to view the contents of a Java Key Store (JKS)

package mindtelligent.custom.jks;

import java.io.File;
import java.io.FileInputStream;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import java.security.KeyStore;

import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;

import java.security.cert.Certificate;

import java.util.Enumeration;

public class ViewJKSAlias {

    private static InputStream is = null;

    public static void main(String[] args) {
        try {

            File file =
                new File("C:\\MindTelligent\\JavaKeyStore\\MindTelligentKeyStore.jks");
            is = new FileInputStream(file);
            KeyStore keystore =
                KeyStore.getInstance(KeyStore.getDefaultType());
            String password = "weblogic01";
            keystore.load(is, password.toCharArray());


            Enumeration enumeration = keystore.aliases();
            while (enumeration.hasMoreElements()) {
                String alias = (String)enumeration.nextElement();
                System.out.println("alias name: " + alias);
                Certificate certificate = keystore.getCertificate(alias);
                System.out.println(certificate.toString());

            }

        } catch (java.security.cert.CertificateException e) {
            e.printStackTrace();
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (KeyStoreException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (null != is)
                try {
                    is.close();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
        }
    }
}

Sunday, November 11, 2012

Oracle SOA 11.1.1.6 Technology Adapters: Enabling High Availability for Oracle File and FTP Adapters

Oracle SOA 11.1.1.6 Technology Adapters: Enabling High Availability for Oracle File and FTP Adapters

The Oracle File and FTP Adapters enable a BPEL process or an Oracle Mediator to read and write files on local file systems and on remote file systems through FTP (File Transfer Protocol). These adapters support high availability for an active-active topology with Oracle BPEL Process Manager and Oracle Mediator service engines for both inbound and outbound operations. To make Oracle File and FTP Adapters highly available for outbound operations, use the database mutex locking 


Note:
The File Adapter picks up a file from the inbound directory, processes it, and then outputs a file to the output directory. Because the File Adapter is non-transactional, files can be processed twice. As a result, it is possible to get duplicate files when there is failover in the RAC backend or in the SOA managed servers.

Using the Database Mutex Locking Operation

Make an outbound Oracle File or FTP Adapter service highly available using database table as a coordinator.
The steps and configuration options for the FTP adapter are exactly the same as the options for the file adapter. The connection factory to be used for FTP HA configuration iseis/Ftp/HAFtpAdapter which appears under the Outbound Connection Pools for the FTPAdapter deployment.


To make outbound Oracle File or FTP Adapters highly available, modify Oracle File Adapter deployment descriptor for the connection-instance corresponding to eis/HAFileAdapter from the Oracle WebLogic Server console:
  1. Log into your Oracle WebLogic Server console. To access the console navigate to the following URL:
    http://servername:portnumber/console
    
  2. Click Deployments in the left pane for Domain Structure.
  3. Click FileAdapter under Summary of Deployments on the right pane.
  4. Click the Configuration tab.
  5. Click the Outbound Connection Pools tab, and expand javax.resource.cci.ConnectionFactory to see the configured connection factories.
  6. Click on Lock & Edit.

    After this, the property value column becomes editable (you can click on any of the rows under "Property Value" and modify its value).
    The new parameters in connection factory for Oracle File and FTP Adapters are as follows:
    controlDir: Set it to the directory structure where you want the control files to be stored. You must set it to a shared location if multiple WebLogic Server instances run in a cluster. Structure the directory for shared storage as follows:
    ORACLE_BASE/admin/domain_name/cluster_name/fadapter
    
    inboundDataSource: Set the value to jdbc/SOADataSource. This is the data source, where the schemas corresponding to high availability are pre-created. The pre-created schemas can be found in the following directory:
    ORACLE_HOME/rcu/integration/soainfra/sql/adapter/createschema_adapter_oracle.sql
    
    If you want to create the schemas elsewhere, use this script. You must set the inboundDataSource property accordingly if you choose a different schema.
    outboundDataSource: Set the value to jdbc/SOADataSource. This is the data source where the schemas corresponding to high availability are pre-created. The pre-created schemas are located in the following directory:
    ORACLE_HOME/rcu/integration/soainfra/sql/adapter/createschema_adapter_oracle.sql
    
    If you want to create the schemas elsewhere, use this script. You must set the outboundDataSource property if you choose to do so.
    outboundDataSourceLocal: Set the value to jdbc/SOALocalTxDataSource. This is the datasource where the schemas corresponding to high availability are pre-created.
    outboundLockTypeForWrite: Set the value to oracle if you are using Oracle Database. By default the Oracle File and FTP Adapters use an in-memory mutex to lock outbound write operations. You must choose from the following values for synchronizing write operations:
    memory: The Oracle File and FTP Adapters use an in-memory mutex to synchronize access to the file system.
    oracle: The adapter uses Oracle Database sequence.
    db: The adapter uses a pre-created database table (FILEADAPTER_MUTEX) as the locking mechanism. You must use this option only if you are using a schema other than the Oracle Database schema.
    user-defined: The adapter uses a user-defined mutex. To configure the user-defined mutex, you must implement the mutex interface: "oracle.tip.adapter.file.Mutex" and then configure a new binding-property with the name"oracle.tip.adapter.file.mutex" and value as the fully qualified class name for the mutex for the outbound reference.
  7. Click Save after you update the properties. The Save Deployment Plan page appears.
  8. Enter a shared storage location for the deployment plan. The directory structure is as follows:
    ORACLE_BASE/admin/domain_name/cluster_name/dp/Plan.xml
    
  9. Click Save and Activate.
  10. Once the new deployment plan has been saved and activated, activate the FileAdapter deployment (the deployment remains in Prepared state if not started). To activate the FileAdapter deployment plan:
    In the Administration Console, click Deployments in the left pane for Domain Structure.
    Select the FileAdapter under Summary of Deployments on the right pane and Select Start, and then Servicing All Requests.
  11. Configure BPEL Process or Mediator Scenario to use the connection factory as shown in the following example (in the jca file included in the composite for the binding component):
    <adapter-config name="FlatStructureOut" adapter="File Adapter" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="eis/HAFileAdapter" adapterRef=""/>
      <endpoint-interaction portType="Write_ptt" operation="Write">
    <interaction-spec className="oracle.tip.adapter.file.outbound.FileInteractionSpec">
          <property../>
          <property../>
        </interaction-spec>
      </endpoint-interaction>
    </adapter-config>
  12. Click eis/HAFileAdapter. The Outbound Connection Properties for the connection factory corresponding to high availability is displayed.






Friday, October 19, 2012

Oracle SOA Suite 11.1.1.6: Monitoring SOA Composite Behavior with SQL Queries

Oracle SOA Suite 11.1.1.6: Monitoring SOA Composite Behavior with SQL Queries


The standard information obtained from Oracle Enterprise Manager Fusion Middleware Control might not be sufficient and adequate for fine grained monitoring. By querying some core product tables in the [PREFIX]_SOAINFRA schema such as the COMPOSITE_INSTANCE, CUBE_INSTANCE, and MEDIATOR_INSTANCE tables, you can get detailed metrics that include success/failure counts, composite instance performance, and durations of invokes as well. Here, we provide two main
queries to obtain performance metrics on BPEL processes and Mediator services, specifically the duration of time that each component took. Though Oracle typically does not recommend querying the product tables directly (since the structure of the tables may change after a patch or upgrade), note that these queries below run fine on Oracle SOA Suite 11g PS3 (11.1.1.4), PS4 (11.1.1.5), and PS5 (11.1.1.6).


The following query outputs a list of all BPEL component instances, their state,
average, minimum, and maximum durations, as well as counts:

SELECT DOMAIN_NAME PARTITION,COMPONENT_NAME,
DECODE(STATE,'1','RUNNING','5','COMPLETED','6',
'FAULTED','9','STALE') STATE,
TO_CHAR(AVG((TO_NUMBER(SUBSTR(TO_CHAR(MODIFY_DATECREATION_
DATE),12,2))*60*60) +
(TO_NUMBER(SUBSTR(TO_CHAR(MODIFY_DATE-CREATION_DATE),15,2))*60) +
TO_NUMBER(SUBSTR(TO_CHAR(MODIFY_DATECREATION_
DATE),18,4))),'999990.000') AVG,
TO_CHAR(MIN((TO_NUMBER(SUBSTR(TO_CHAR(MODIFY_DATECREATION_
DATE),12,2))*60*60) +
(TO_NUMBER(SUBSTR(TO_CHAR(MODIFY_DATE-CREATION_DATE),15,2))*60) +
TO_NUMBER(SUBSTR(TO_CHAR(MODIFY_DATECREATION_
DATE),18,4))),'999990.000') MIN,
TO_CHAR(MAX((TO_NUMBER(SUBSTR(TO_CHAR(MODIFY_DATECREATION_
DATE),12,2))*60*60) +
(TO_NUMBER(SUBSTR(TO_CHAR(MODIFY_DATE-CREATION_DATE),15,2))*60) +
TO_NUMBER(SUBSTR(TO_CHAR(MODIFY_DATECREATION_
DATE),18,4))),'999990.000') MAX,
COUNT(1) COUNT
FROM CUBE_INSTANCE
GROUP BY DOMAIN_NAME, COMPONENT_NAME, STATE
ORDER BY COMPONENT_NAME, STATE


The following query displays a list of all Mediator component instances, their state,
average, minimum, and maximum durations, as well as counts:

SELECT SUBSTR(COMPONENT_NAME, 1, INSTR(COMPONENT_NAME,'/')-1)
PARTITION,
SUBSTR(COMPONENT_NAME, INSTR(COMPONENT_NAME,'/')+1,
INSTR(COMPONENT_NAME,'!')-INSTR(COMPONENT_NAME,'/')-1) COMPONENT,
SOURCE_ACTION_NAME ACTION,
DECODE(COMPONENT_STATE,'0','COMPLETED','2',
'FAULTED','3','ABORTED','4','RECOVERY
NEEDED','8','RUNNING','16','STALE') STATE,
TO_CHAR(AVG((TO_NUMBER(SUBSTR(TO_CHAR(UPDATED_TIMECREATED_
TIME),12,2))*60*60) +
(TO_NUMBER(SUBSTR(TO_CHAR(UPDATED_TIME-CREATED_TIME),15,2))*60) +
TO_NUMBER(SUBSTR(TO_CHAR(UPDATED_TIMECREATED_
TIME),18,4))),'999990.000') AVG,
TO_CHAR(MIN((TO_NUMBER(SUBSTR(TO_CHAR(UPDATED_TIMECREATED_
TIME),12,2))*60*60) +
(TO_NUMBER(SUBSTR(TO_CHAR(UPDATED_TIME-CREATED_TIME),15,2))*60) +
TO_NUMBER(SUBSTR(TO_CHAR(UPDATED_TIMECREATED_
TIME),18,4))),'999990.000') MIN,
TO_CHAR(MAX((TO_NUMBER(SUBSTR(TO_CHAR(UPDATED_TIMECREATED_
TIME),12,2))*60*60) +
(TO_NUMBER(SUBSTR(TO_CHAR(UPDATED_TIME-CREATED_TIME),15,2))*60) +
TO_NUMBER(SUBSTR(TO_CHAR(UPDATED_TIMECREATED_
TIME),18,4))),'999990.000') MAX,
COUNT(1) COUNT
FROM MEDIATOR_INSTANCE
GROUP BY COMPONENT_NAME, SOURCE_ACTION_NAME, COMPONENT_STATE
ORDER BY COMPONENT_NAME, SOURCE_ACTION_NAME, COMPONENT_STATE




Monday, October 8, 2012

Fusion Middleware/ Oracle SOA 11.1.1.6 :Switching the JVM from Sun JDK to JRockit JDK

Fusion Middleware/ Oracle SOA 11.1.1.6 :Switching the JVM from Sun JDK to JRockit JDK


1. Download and install Oracle JRockit JDK (latest version currently 28.2.0):


  • Download JRockit for Linux x86-64 from http://www.oracle.com/technetwork/middleware/jrockit/downloads/index.html.
  • Execute the following command to change permissions and start the installer:

           chmod 750 jrockit-jdk1.6.0_29-R28.2.0-4.1.0-linux-x64.bin
          ./jrockit-jdk1.6.0_29-R28.2.0-4.1.0-linux-x64.bin

  • On the Welcome prompt, press Enter.
  • On the Choose Production Installation Directory prompt, enter a directory such as /u01/app/oracle/jrockit1.6.0_29, to install JRockit and press Enter twice.
  • On the Optional Components 1 prompt, press Enter to accept the default (which is not to install Demos and Samples).
  • On the Optional Components 2 prompt, press Enter to accept the default (which is not to install Source Code).
  • On the Installation Complete prompt, press Enter to exit the installer.
2. Log on to the Linux server hosting your Oracle SOA Suite 11g installation as the oracle user.
3. Stop the AdminServer as well as all managed servers.
4. Stop the Node Manager.
5. Edit the file $MW_HOME/wlserver_10.3/common/bin/commEnv.sh and replace the following two entries     
     as follows:
         OLD: JAVA_HOME="/u01/app/oracle/jdk1.6.0_26"
         NEW: JAVA_HOME="/u01/app/oracle/jrockit1.6.0_29"
         OLD: JAVA_VENDOR=Sun
         NEW: JAVA_VENDOR=Oracle
6.Edit the file $MW_HOME/user_projects/domains/[Domain]/bin/setDomainEnv.sh, and replace the 
   following two entries as follows:
   OLD: BEA_JAVA_HOME=""
   NEW: BEA_AVA_HOME="/u01/app/oracle/jrockit1.6.0_29"
   OLD: SUN_JAVA_HOME="/u01/app/oracle/jdk1.6.0_26"
   NEW: SUN_JAVA_HOME=""

7. Edit the domain configuration file $MW_HOME/user_projects/domains/[Domain]/bin/setSOADomainEnv.sh, and replace the following entry
as follows:  
    OLD: PORT_MEM_ARGS="-Xms768m -Xmx1536m"
    NEW: PORT_MEM_ARGS="-Xms1536m -Xmx1536m -Xgcprio:throughput
    -XX:+HeapDumpOnOutOfMemoryError

8.Start up the Node Manager.
9. Boot up the AdminServer and all managed servers back again.

10. View the new JDK being used in the $DOMAIN_HOME/servers/AdminServer/logs/AdminServer.log

Thursday, August 23, 2012

Oracle SOA 11g 11.1.1.6 Performance Tuning of BPEL: Significant Tips

Oracle SOA 11g 11.1.1.6 Performance Tuning of BPEL: Significant Tips 


OneWayDeliveryPolicy

The oneWayDeliveryPolicy is from the Oracle 10g configuration property deliveryPersistencePolicy.
The new configuration property name is bpel.config.oneWayDeliveryPolicy.

The oneWayDeliveryPolicy property controls database persistence of messages entering Oracle BPEL Server. By default, incoming requests are saved in the delivery service database tabledlv_message. These requests are later acquired by Oracle BPEL Server worker threads and delivered to the targeted BPEL process. This property persists delivery messages and is applicable to durable processes.
When setting the oneWayDeliveryPolicy property to async.cache, if the rate at which one-way messages arrive is much higher than the rate at which Oracle BPEL Server delivers them, or if the server fails, messages may be lost. In addition, the system can become overloaded (messages become backlogged in the scheduled queue) and you may receive out-of-memory errors. Consult your own use case scenarios to determine if this setting is appropriate.
One-way invocation messages are stored in the delivery cache until delivered. If the rate at which one-way messages arrive is much higher than the rate at which Oracle BPEL Server delivers them, or if the server fails, messages may be lost.
ValueDescription
async.persist (Default)Delivery messages are persisted in the database. With this setting, reliability is obtained with some performance impact on the database. In some cases, overall system performance can be impacted.
async.cacheIncoming delivery messages are kept only in the in-memory cache. If performance is preferred over reliability, this setting should be considered.
syncDirects 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.




MaximumNumberOfInvokeMessagesInCache

This property specifies the number of invoke messages that can be kept in the in-memory cache. Once the engine hits this limit, it would push the message to dispacther in-memory cache, instead it would save the message in the db and these saved messages can be recovered using recovery job. You can use value -1 to disable.
The default value is 100000 messages.



StatsLastN

The StatsLastN property sets the size of the most-recently processed request list. After each request is finished, statistics for the request are kept in a request list. A value less than or equal to 0 disables statistics gathering. To optimize performance, consider disabling statistics collection if you do not need them.
This property is applicable to both durable and transient processes.
The default value is -1.


LargeDocumentThreshold

The largedocumentthreshold property sets the large XML document persistence threshold. This is the maximum size (in kilobytes) of a BPEL variable before it is stored in a separate table from the rest of the instance scope data.
This property is applicable to both durable and transient processes.
Large XML documents impact the performance of the entire Oracle BPEL Server if they are constantly read in and written out whenever processing on an instance must be performed.
The default value is 10000 (100 kilobytes).


Validate XML

The validateXML property validates incoming and outgoing XML documents. If set to True, the Oracle BPEL Process Manager applies schema validation for incoming and outgoing XML documents. Nonschema-compliant payload data is intercepted and displayed as a fault.
This setting is independent of the SOA composite application and SOA Infrastructure payload validation level settings. If payload validation is enabled at both the service engine and SOA Infrastructure levels, data is checked twice: once when it enters the SOA Infrastructure, and again when it enters the service engine
CAUTION: Enabling XML payload validation can impact performance.
This property is applicable to both durable and transient processes.
The default value is False.



SyncMaxWaitTime

The SyncMaxWaitTime property sets the maximum time the process result receiver waits for a result before returning. Results from asynchronous BPEL processes are retrieved synchronously by a receiver that waits for a result from Oracle BPEL Server.
The default value is 45 seconds.


InstanceKeyBlockSize

The InstanceKeyBlockSize property controls the instance ID range size. Oracle BPEL Server creates instance keys (a range of process instance IDs) in batches using the value specified. After creating this range of in-memory IDs, the next range is updated and saved in the ci_id_range table.
For example, if instanceKeyBlockSize is set to 100, Oracle BPEL Server creates a range of instance keys in-memory (100 keys, which are later inserted into the cube_instance table as cikey). To maintain optimal performance, ensure that the block size is larger than the number of updates to the ci_id_range table.
The default value is 10000.


MaxRecoverAttempt

You can configure the number of automatic recovery attempts to submit in the same recoverable instance. The value you provide specifies the maximum number of times invoke and callback messages are recovered. Once the number of recovery attempts on a message exceeds the specified value, a message is marked as nonrecoverable.
When a BPEL instance makes a call to another server using invokeMessage, and that call fails due to a server down, validation error, or security exception, the invokeMessage is placed in a recovery queue and BPEL attempts to retry those messages. When there are many messages, and a majority of them are being sent to the same target, the target can become overloaded. Setting the appropriate value of MaxRecoveryAttempt will prevent excessive load on servers that are targeted from BPEL web service calls.










Oracle SOA 11g 11.1.1.6 Performance Tuning of BPEL Processes:Audit

Oracle SOA 11g 11.1.1.6 Performance Tuning of BPEL Processes:Audit


AuditLevel

The auditLevel property sets the audit trail logging level. This configuration property is applicable to both durable and transient processes. This property controls the amount of audit events that are logged by a process. Audit events result in more database inserts into the audit_trail table which may impact performance. Audit information is used only for viewing the state of the process from Oracle Enterprise Manager Console.

ValueDescription
InheritInherits the audit level from infrastructure level.
OffNo audit events (activity execution information) are persisted and no logging is performed; this can result in a slight performance boost for processing instances.
MinimalAll events are logged; however, no audit details (variable content) are logged.
ErrorLogs only serious problems that require immediate attention from the administrator and are not caused by a bug in the product. Using this level can help performance.
ProductionAll events are logged. The audit details for assign activities are not logged; the details for all other activities are logged.
DevelopmentAll events are logged; all audit details for all activities are logged.




AuditDetailThreshold

The auditdetailthreshold property sets the maximum size (in kilobytes) of an audit trail details string before it is stored separately from the audit trail. If an audit trail details string is larger than the threshold setting, it is not immediately loaded when the audit trail is initially retrieved; a link is displayed with the size of the details string. Strings larger than the threshold setting are stored in theaudit_details table, instead of the audit_trail table.
The details string typically contains the contents of a BPEL variable. In cases where the variable is very large, performance can be severely impacted by logging it to the audit trail.
The default value is 50000 (50 kilobytes).

AuditStorePolicy

This property specifies the strategy to persist the BPEL audit data.
ValueDescription
syncSingleWrite (default)AuditTrail and dehydration are persisted to DB in one transaction.
syncMultipleWriteAuditTrail and dehydration are persisted in the same thread but separate transactions.
asyncAuditTrail and dehydration are persisted by separate threads and separate transactions.
By default, audit messages are stored as part of the main BPEL transaction. A BPEL instance holds on to the audit messages until the flow reaches dehydration. In some use cases, for example when you have a large loop, and there is no dehydration point in the loop, a large number of audit logs are accumulated. This could lead to an out-of-memory issue and BPEL main transaction can experience timeout errors. You may consider using syncMultipleWrite or async to store the audit message separately from the main transaction.
When you use syncMultipleWrite and async auditStorePolicy, there are a few other properties that need to be considered. Please see the sections below.


AuditFlushByteThreshold

This property controls how often the engine should flush the audit events, basically after adding an event to the current batch, the engine checks to see if the current batch byte size is greater than this value or not.
Consider tuning this property when async or syncMultipleWrite audit strageties are used. This size needs to be tuned based on the application.


AuditFlushEventThreshold

This property controls how often the engine should flush the audit events, basically when it reaches this limit of the number of events, the engine would trigger the store call.
Consider tuning this property when async or syncMultipleWrite audit strageties are used. This size needs to be tuned based on the application.





Oracle SOA 11g 11.1.1.6 Performance Tuning of BPEL Processes:BPEL Threading Model

Oracle SOA 11g 11.1.1.6 Performance Tuning of BPEL Processes:BPEL Threading Model

When the dispatcher must schedule a dispatch message for execution, it can enqueue the message into a thread pool. Each dispatch set can contain a thread pool (java.util.concurrent.ThreadPoolExecutor). The BPEL thread pool implementation notifies the threads when a message has been enqueued and ensures the appropriate number of threads are instantiated in the pool.

Dispatcher System Threads

The dspSystemThreads property specifies the total number of threads allocated to process system dispatcher messages. System dispatcher messages are general clean-up tasks that are typically processed quickly by the server (for example, releasing stateful message beans back to the pool). 

Typically, only a small number of threads are required to handle the number of system dispatch messages generated during run time.

The minimum number of threads for this thread pool is 1 and it cannot be set to 0 a or negative number.
The default value is 2. Any value less than 1 thread is changed to the default.


Dispatcher Invoke Threads

The dspInvokeThreads property specifies the total number of threads allocated to process invocation dispatcher messages. Invocation dispatcher messages are generated for each payload received and are meant to instantiate a new instance.
If the majority of requests processed by the engine are instance invocations (as opposed to instance callbacks), greater performance may be achieved by increasing the number of invocation threads. Higher thread counts may cause greater CPU utilization due to higher context switching costs.

The minimum number of threads for this thread pool is 1 and it cannot be set to 0 a or negative number.
The default value is 20 threads. Any value less than 1 thread is changed to the default.



Dispatcher Engine Threads

The dspEngineThreads property specifies the total number of threads allocated to process engine dispatcher messages. Engine dispatcher messages are generated whenever an activity must be processed asynchronously. If the majority of processes deployed are durable with a large number of dehydration points (mid-process receive, onMessage, onAlarm, and wait activities), greater performance may be achieved by increasing the number of engine threads.


Note that higher thread counts can cause greater CPU utilization due to higher context switching costs.

The minimum number of threads for this thread pool is 1 and it cannot be set to 0 a or negative number.
The default value is 30 threads. Any value less than 1 thread is changed to the default.



Dispatcher Maximum Request Depth

The dspMaxRequestDepth property sets the maximum number of in-memory activities to process within the same request. After processing an activity request, Oracle BPEL Process Manager attempts to process as many subsequent activities as possible without jeopardizing the validity of the request. Once the activity processing chain has reached this depth, the instance is dehydrated and the next activity is performed in a separate transaction.
If the request depth is too large, the total request time can exceed the application server transaction time out limit.This process is applicable to durable processes.

The default value is 600 activities.









Oracle SOA 11g 11.1.1.6 Performance Tuning of BPEL Processes:BPEL Properties Set Inside a Composite


Oracle SOA 11g 11. 1.1.6 Performance Tuning of BPEL Processes

BPEL Properties Set Inside a Composite

This section lists the config properties of some sections of the deployment descriptor. For each configuration property parameter, a description is given, as well as the expected behavior of the engine when it is changed.
All the properties set in this section affect the behavior of the component containing the BPEL process only. Each BPEL process can be created as a component of a composite. These properties can be modified in composite.xml or in the System MBean Browser of Oracle Enterprise Manager Fusion Middleware Control. 


Some Concepts First

As a general practice, it is better to design your BPEL processes as transient instead of durable if performance is a concern. Note that this may not always be possible due to the nature of your process, but keep the following points in mind.

The dehydration store is uses to maintain long-running asynchronous BPEL instances storing state information as they wait for asynchronous callbacks. This ensures the reliability of these processes in the event of server or network loss.
 Oracle BPEL Process Manager supports two types of processes; transient and durable.

Transient Processes
Transient processes do not incur dehydration during their process execution. If an executing process experiences an unhandled fault or the server crashes, instances of a transient process do not leave a trace in the system. Thus, these instances cannot be saved in-flight regardless if they complete normally or abnormally. Transient processes are typically short-lived, request-response style processes. Synchronous processes are examples of transient processes.

Durable Processes
Durable processes incur one or more dehydration points in the database during execution. Dehydration is triggered by one of the following activities:
  • Receive activity
  • OnMessage branch in a pick activity
  • OnAlarm branch in a pick activity
  • Wait activity
  • Reply activity
  • checkPoint() within a <bpelx:exec> activity


 inMemoryOptimization

This property indicates to Oracle BPEL Server that this process is a transient process and dehydration of the instance is not required. When set to True, the completionPersistPolicy is used to determine persistence behavior. This property can only be set to True for transient processes or processes that do not contain any dehydration points such as receive, wait, onMessage and onAlarm activities. The inMemoryOptimization property is set at the BPEL component level. When set to False, dehydration is disabled which can improve performance in some use cases.
Values:
This property has the following values:
  • False (default): instances are persisted completely and recorded in the dehydration store database.
  • True: The completionPersist policy is used to determine persistence behavior. 


completionPersistPolicy

This property configures how the instance data is saved. It can only be set at the BPEL component level. The completionPersistPolicy property can only be used when inMemoryOptimization is set to be True (transient processes). Note that this parameter may affect database growth and throughput (due to reduced I/O).
ValueDescription
On (default)The completed instance is saved normally
DeferredThe completed instance is saved, but with a different thread and in another transaction.
FaultedOnly the faulted instances are saved.
Note: When an unhandled fault occurs, regardless of these flags, audit information of the instance is persisted within cube_instance table.
OffNo instances of this process are saved.
<component name="BPELProcess">
   <implementation.bpel src="BPELProcess.bpel" />

   <property name="bpel.config.completionPersistPolicy">faulted</property>
   <property name="bpel.config.inMemoryOptimization">true</property>
   ...
</component>

auditLevel

You can set the audit level for a BPEL process service component. This setting takes precedence over audit level settings at the SOA Infrastructure, service engine, and SOA composite application levels.
Set the bpel.config.auditLevel property to an appropriate value in the composite.xml file of your SOA project as shown in the example below:
<component name="BPELProcess">
<implementation.bpel src="BPELProcess.bpel" />
<property name="bpel.config.auditLevel">Off</property>
</component>
ValueDescription
InheritInherits the audit level from infrastructure level.
OffNo audit events (activity execution information) are persisted and no logging is performed; this can result in a slight performance boost for processing instances.
MinimalAll events are logged; however, no audit details (variable content) are logged.
ErrorLogs only serious problems that require immediate attention from the administrator and are not caused by a bug in the product. Using this level can help performance.
ProductionAll events are logged. The audit details for assign activities are not logged; the details for all other activities are logged.
DevelopmentAll events are logged; all audit details for all activities are logged.

Partner Link Property

You can dynamically configure a partner link at runtime in BPEL. This is useful for scenarios in which the target service that BPEL wants to invoke is not known until runtime. The following Partner Link properties can be tuned for performance:


idempotent

An idempotent activity is an activity that can be retried (for example, an assign activity or an invoke activity). Oracle BPEL Server saves the instance after a nonidempotent activity. This property is applicable to both durable and transient processes.
Values:
This property has the following values:
  • False: Activity is dehydrated immediately after execution and recorded in the dehydration store. When idempotent is set to False, it provides better failover protection, but may impact performance if the BPEL process accesses the dehydration store frequently.
  • True (default): If Oracle BPEL Server fails, it performs the activity again after restarting. This is because the server does not dehydrate immediately after the invoke and no record exists that the activity executed. Some examples of where this property can be set to True are: read-only services (for example, CreditRatingService) or local EJB/WSIF invocations that share the instance's transaction.

A BPEL invoke activity is by default 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.
When idempotent is set to false, it provides better failover protection, but at the cost of some performance, since the BPEL process accesses the dehydration store much more frequently. This setting can be configured for each partner link in the bpel.xml file.



nonBlockingInvoke

By default, Oracle BPEL Process Manager executes in a single thread by executing the branches sequentially instead of in parallel. When this property is set to True, the process manager creates a new thread to perform each branch's invoke activity in parallel. This property is applicable to both durable and transient processes.
Consider setting this property to True if you have invoke activities in multiple flow or flow n branches. This is especially effective if the parallel invoke activities are two-way, but some benefits can be realized for parallel one-way invokes as well.
Note:
Invocations to the same partner link will happen in sequence and not in parallel. If you invoke different partner links each time with nonBlockingInvoke set to True, then each link will work in parallel even if all of the partner links point to the same source.
Values:
  • True: Oracle BPEL Server spawns a new thread to execute the invocation.
  • False (default): Oracle BPEL Server executes the invoke activity in the single process thread.

validateXML

Enables message boundary validation. Note that additional validation can impact performance by consuming extra CPU and memory resources.
Values:
  • True: When set to True the engine validates the XML message against the XML schema during <receive> and <invoke> for this partner link. If the XML message is invalid thenbpelx:invalidVariables run time BPEL Fault is thrown. This overrides the domain level validateXML property.
  • False (default): Disables XML validation.


General Recommendations:
1. If your Synchronous process exceed, say 1000 instances per hour, then its better to set inMemoryOptimization to true and completionPersistPolicyto faulted, So that we can get better throughput, only faulted instances gets dehydrated in the database, its goes easy on the purge (purging historical instance data from database)
2. Do not include any settings to persist your process such as (Dehydrate, mid process receive, wait or Onmessage)
3. Have good logging on your BPEL Process, so that you can see log messages in the diagnostic log files for troubleshooting.
What should you do?
  • If the design of the process allows it, design your BPEL processes as short-lived, synchronous transactions.
  • If the design of the process allows it, avoid the activities listed above.
Any time your process is dehydrated to the dehydration store, this naturally impacts the performance of the process, and becomes a concern particularly in high volume environments.


Sunday, June 10, 2012

Oracle BPEL Process Manager Performance Tuning: Change SyncMaxWaitTime

Oracle BPEL Process Manager Performance Tuning: Change SyncMaxWaitTime


The SyncMaxWaitTime property sets the maximum time the process result receiver waits for a result before returning. Results from asynchronous BPEL processes are retrieved synchronously by a receiver that waits for a result from Oracle BPEL Server. This property is applicable to transient processes. The default value is 45 seconds. This property controls the maximum time the process result receiver will wait for a result before returning for Sync processes.

To change the property using Enterprise Manager:


  • Expand soa-infra 
  • Right Click
  • Expand SOA Administration



  • Clkick BPEL Properties.
  • This will navigate you to BPEL Properties page.

  • On the BPEL Service Engine Properties, click on More BPEL Configuration Properties...






  • Look for  SyncMaxWaitTimeand change the value. The default value is 45 seconds
  • Click Apply on Upper Right section of the page.

Saturday, June 9, 2012

Oracle SOA 11.1.1.5 Generate XSD From a Flat File

Oracle SOA 11.1.1.5 Generate XSD From a Flat File


This thread discusses steps to create an XML Schema (XSD) from a sample payload. The payload we are discussing here is a CSV file. The CSV file has header records, and the thread will highlight how the contents of the header records can be used in defining the elements of the generated schema.


  • Create a new SOA Project using JDeveloper you may call it GenerateXSDFormFlatFile. as shown below.
  • Press Next.





  • Choose the Empty Composite option .
  • Press Next.






  • From the resource pallet, choose the File Adapter in the Exposed Services Swim Lane.
  • Press Next.








  • Put the Service Name GenerateXSDFromFlatFile_FileAdapter.










  • Choose "Define from operation and schema" option.
  • Press Next.








  • Choose the option to Read File.
  • Choose Operation Name as Read.
  • Press Next.










  • Choose the directory where the file is located.
  • Press Next.










  • Choose the name of the file.
  • Press Next.








  • Press Next.










  • Ensure that the Native Format translation is not required is Unchecked.
  • On the Right Hand Side, click the Icon to Define Native Format.






  • Welcome screen will be displayed.
  • Press Next.






  • Since our file is comma delimited, choose this Delimited option.
  • Press Next.





  • Ensure that the file name is correct
  • Press Next.




  • Enter a name that will represent the record, Employee in this case.
  • Press Next.






  • Choose the Delimited By Symbol, Comma(,).
  • Press Next.





  • Check the Use the first record as the Field Name. This will ensure that entries in the header record are reflected as the elements of the schema.
  • Press Next.





  • The schema is generated in the xsd folder of the project.
  • Press Next.





  • Press Finish.



The Generated XSD looks like


<?xml version="1.0" encoding="UTF-8" ?>


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
            xmlns:tns="http://TargetNamespace.com/ServiceName"
            targetNamespace="http://TargetNamespace.com/ServiceName"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"


            nxsd:version="NXSD"
            nxsd:stream="chars"
            nxsd:encoding="US-ASCII"
            nxsd:hasHeader="true"
            nxsd:headerLines="1"
            nxsd:headerLinesTerminatedBy="${eol}"
>




  <xsd:element name="Root-Element">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Employee" minOccurs="1" maxOccurs="unbounded">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="FirstName" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy="&quot;" />
              <xsd:element name="LastName" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy="&quot;" />
              <xsd:element name="Age" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy="&quot;" />
              <xsd:element name="DOB" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy="&quot;" />
              <xsd:element name="Salary" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>


</xsd:schema>
<!--NXSDWIZ:C:\MindTelligent\Empoloyees.txt:-->
<!--USE-HEADER:true:-->



















































OCI Knowledge Series: OCI Infrastructure components

  Oracle Cloud Infrastructure (OCI) provides a comprehensive set of infrastructure services that enable you to build and run a wide range of...