Tuesday, March 27, 2012

Oracle SOA/BPEL/ESB Timeout Configuration

Transaction timeout configuration settings are need to be carried out in below set of configuration points.


1. Global Transaction Timeout: Set the global transaction time out value in transaction-timeout attribute of transaction-manager.xml.

  a) Edit transaction-manager.xml from $ORACLE_HOME\j2ee\oc4j_soa\config\transaction-manager.xml
  b) Find the transaction-timeout parameter and change its value to 7200(Seconds).
  c) Save and close the file.

2. EJB Timeout: transaction-timeout attribute controls the transaction timeout interval (in seconds), If the transaction has not completed in this timeframe, the transaction is rolled back.

  a) Edit orion-ejb-jar.xml from $ORACLE_HOME\j2ee\oc4j_soa \application-deployments\orabpel\ejb_ob_engine\orion-ejb-jar.xml
  b) Find all occurrences of the transaction-timeout parameter and change its value to 3600 (Seconds).
  c) Save and close the file.

3. SyncMaxWaitTime is a domain level property and its setting is applicable for synchronous durable bpel processes

  a) Log in to the BPEL Console.
  b) Click the Configuration tab.
  c) Change the value of syncMaxWaitTime to 240 (seconds) and click on Apply

4. ESB Timeout: Edit esb_config.ini file from $ORACLE_HOME/integration/esb/config/esb_config.ini

  a) Change the value of xa_timeout parameter to 900 (Seconds).

5. Restart the server to make effect of all the changes.

Monday, March 26, 2012

Oracle BRM JCA Adapter logging on Oracle Application Server

The JCA Resource Adapter supports Java Unified Logging (JUL), which allows the adapter to use the Oracle Application Server logging library.


Follow below instruction to enable BRM JCA Adapter logging:

1. Create directory: $Oracle_home/j2ee/Instance/application-deployments/default/BRMAdapter/logs.

2. Edit $Oracle_home/j2ee/Instance/config/j2ee-logging.xml file in an XML editor.

3. Add following lines under the <log_handlers> element:

  <log_handlers>
  <log_handler name="brm-handler" class="oracle.core.ojdl.logging.ODLHandlerFactory">
  <property name="path" value="Oracle_home/j2ee/oc4j_soa/application-deployments/default/BRMAdapter/logs/BRMAdapterLog.log"/>
  <property name="maxFileSize" value="10485760"/>
  <property name="maxLogSize" value="104857600"/>
  <property name="encoding" value="UTF-8"/>
  <property name="format" value="ODL-TEXT"/>
  </log_handler>
  </log_handlers>

  where,
  o Path specifies the directory in which the adapter creates the log file.
  o maxFileSize specifies the maximum size, in bytes, of the log file. When a log file reaches this limit, a new log  file is generated.
  o maxLogSize specifies the maximum size, in bytes, of the logging directory.
  o encoding must be set to UTF-8.
  o format must be set to ODL-TEXT. This enables you to view the log files directly in the Oracle Application Server control console.

4. Add the following lines under the <loggers> element:

  <loggers>
  <logger name="oracle.tip.adapter.brm" level="LogLevel" useParentHandlers="false">
  <handler name="oc4j-handler"/>
  <handler name="brm-handler"/>
  </logger>

  where LogLevel is set to one of the following:

  o SEVERE to log problems that require attention from the system administrator.
  o WARNING to log actions that should be reviewed and may require action before an error occurs.
  o INFO to log normal actions or events. This includes user operations, such as user log ins, and automatic operations, such as log file rotations.
  o CONFIG to log configuration-related messages.
  o FINE to log trace or debug messages for performance monitoring.
  o FINER to log highly detailed trace or debug message.
  o FINEST to log the most detailed trace or debug messages.

5. Save and close the file.

6. Restart the application server or the J2EE instance.

Thursday, March 22, 2012

Oracle BPEL configuration settings to handle large payload/document

Processing of big payload in BPEL process may result in following problem.


1) OutOfMemoryError - Increase the java heap size

Refer my previous posts on how to increase the heap.

2) Process hangs with out result - This occurs due to huge number of activities generated during bpel instance processing.

Process hangs due to maximum number of in-memory activities. You may get "Instance not found in datasource" or "Maximum request depth exceeded" errors. Process will also throw 'TimeOut' error for synchronous processes after reaching the tansaction-timeout duration.

To solve this problem, we need to add 'dspMaxRequestDepth' property in $ORACLE_HOME/bpel/domains/default/config/domain.xml file.

This 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 transactionality 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. The default value is 600 activities.

Please add below set of property elements in domain.xml and restart the server to take effect of the changes. Here in below property, I have set the maximum in-memory activities as 4000.

<property id="dspMaxRequestDepth">
<name>Maximum number of in memory activities</name>
<value>4000</value>
<comment><![CDATA[
This 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 transactionality 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.
<p/>
If the request depth is too large, the total request time can exceed the application server transaction timeout limit.
<p/>
The default value is 600 activities.
]]></comment>
</property>

3) Time out error - Increase the timeout setting

How to configure timeout setting will come in my next posting.

Wednesday, March 7, 2012

Export Cross Reference Table

Set below environment variables.


export OC4J_USERNAME=oc4jadmin
export OC4J_PASSWORD=oc4jadmin
export DB_URL=jdbc:oracle:thin:@HOST_NAME:1521:SERVICE_ID
export DB_USER=aia
export DB_PASSWORD=aia

Execute below commands to export ITEM_ITEMID table to Item_Xref.xml file.

$ cd $ORACLE_HOME/integration/esb/bin

$ ./xrefexport.sh -file ./Item_Xref.xml -table ITEM_ITEMID

NOTE: If you encounter any error as below then set the environment variable 'export oc4j_username=oc4jadmin' and 'export oc4j_password=welcome1' instead of upper_case variable name

$ ./xrefexport.sh -file ./Item_Xref.xml -table ITEM_ITEMID

./xrefexport.sh[49]: test: Specify a parameter with this command.
invoke:Connection Details =sun.net.www.protocol.http.HttpURLConnection:http://HostName:7777/esb/j_security_check
postAndReceive:Connection response code = 302
getCookie:Final cookie value = JSESSIONID=39256409e4e9d3aa94731f05baa844eb8e9e35bf6cde13a5b37bd08c486c6aa8.e3mMc3qLbN8Le34RbN4Rch8Na3j0; path=/esb
invoke:Connection Details =sun.net.www.protocol.http.HttpURLConnection:http://HostName:7777/esb/login_error.jsp
postAndReceive:Connection response code = 200
getCookie:Final cookie value = JSESSIONID=39256409e4e9d3aa94731f05baa844eb8e9e35bf6cde13a5b37bd08c486c6aa8.e3mMc3qLbN8Le34RbN4Rch8Na3j0; path=/esb
Export Failed .. reason : "Authendication Failed"


Above error occurs due to a bug in xrefexport.sh which reads the environment variable oc4j username and password with lower case oc4j_username/oc4j_password. This error occurs only in some versions of SOA Suite alone.