Sunday 8 June 2014

Transaction Timeout for BPEL

During runtime you may be seeing errors in the log similar to the following:

The transaction was rolled back
or
Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: Transaction timed out.


Solution :

The solution is typically to increase the transaction timeout for the process. 
 
syncMaxWaitTime < BPEL EJB's transaction timeout < Global Transaction Timeout

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.


-- Alternative Method -- For SOA 11g R1 (11.1.1.1.0) ONLY:
* Take backup of bpel-config.xml, located at: /user_projects/domains//config/soa-infra/configuration/.
* Open the bpel-config.xml file.
* Edit the value for the syncMaxWaitTime property.
* Save the changes.
* Restart Oracle WebLogic Server.
 
 
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 (See step 3).
 
 
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
* 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.