Saturday, June 8, 2013

Timeout setting in SOA 11g for tuning BPELs

Configure Transaction Timeout or Tune Up BPEL SOA 11g for rolled back error or Timed out Exception

Problem:
During runtime you may be seeing errors in the log similar to the following:
The transaction was rolled back
 and / or
<faultstring>java.lang.IllegalStateException: Cannot call setRollbackOnly() current thread is NOT associated with a transaction</faultstring>
 and / or
Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: Transaction timed out
The solution is typically to increase the transaction timeout for the process.

Solution:
 
As a general rule, you should keep the following relation between the timeout parameters: 
syncMaxWaitTime < BPEL EJB's transaction timeout < Global Transaction Timeout(JTA) 
Few recommendations are, 
900<1800<2400 - For Medium load
900<3200<3600 - For Large load
sometimes depending on your requirement/load you might need to go for higher values. 

1. Setting syncMaxWaitTime: 
This property controls the maximum time the process result receiver will wait for a result before returning for Sync processes.
 For SOA 11g R1 PS1 (11.1.1.1.0 to 11.1.1.5):
 * Login into EM
* Expand SOA and right click on "soa-infra" and select: SOA Administration -> BPEL Properties
* Click on "More BPEL Configuration Properties..." link
* Locate syncMaxWaitTime and change it. 

2. Setting the transaction timeout for BPEL EJBs: 
The timeout properties for the EJBs control the particular timeout setting for the SOA application, overriding the global setting specified by the JTA timeout.
* Log into Oracle WebLogic Administration Console.
* Click Deployments.
* Expand soa-infra -> EJBs.
* Following EJBs need to be updated: 
BPELActivityManagerBean
BPELDeliveryBean
BPELDispatcherBean
BPELEngineBean
BPELFinderBean
BPELInstanceManagerBean
BPELProcessManagerBean
BPELSensorValuesBean
BPELServerManagerBean
 
* You can change the parameter in the Configuration tab for the Transaction Timeout setting.
* Click Save.
* Save the Plan.xml to some known location - Ensure no other file is named Plan.xml.
* Update soa-infra deployment.
* Start SOA Managed Server. 

3. Setting the global transaction timeout at Weblogic Domain Level: 
This property controls the transaction timeout seconds for active transactions. If the transaction is still in the "active" state after this time, it is automatically rolled back.
* Log into Oracle WebLogic Administration Console.
* Click Services -> JTA.
* Change the value of Timeout Seconds (the default is 30).
* Click Save.
* Restart Oracle WebLogic Server.