Showing posts with label JTA. Show all posts
Showing posts with label JTA. Show all posts

Saturday, 30 December 2017

JTA transaction is not present or the transaction is not in active state

You might have faced this strange error in your BPEL flow which occurs when you are connecting to a particular Partner link from the BPEL process. If this occurs in 10.1.3.5 server you can resolve it by following the steps mentioned below. The error thrown will have the error details as:


ORABPEL-02182
JTA transaction is not present or the transaction is not in active state.
The current JTA transaction is not present or it is not in active state when processing activity or instance "100560639-BpInv4-BpSeq4.3-9". The reason is The execution of this instance "100560639-BpInv4-BpSeq4.3-9" for process "XYZ" is supposed to be in a jta transaction, but the transaction is not present or in active state, please turn on the application server transaction debug logs to get more information..
Please consult your administrator regarding this error.


To resolve this you have to follow the following steps:
  1. Stop the SOA Server 
  2. Set Transaction-timeout value to 7200 or more in the following file: $SOA_Home\j2ee\config\transaction-manager.xml
  3. Set transaction-timeout value to 3600 or more in $SOA_Home\j2ee\application-deployments\orabpel\ejb_ob_engine\orion-ejb-jar.xml 
  4. Set syncMaxWaitTime to 240 or more in $SOA_Home\bpel\domains\config\domain.xml.
  5. Restart the SOA server.
This should resolve the JTA transaction issu

JTA transaction is not in active state: The transaction status is "MARKED_ROLLBACK".

This issue generally comes due to low value (default value i.e. 30) set for JTA transaction timeout. To solve the above problem try the following things.

Setting syncMaxWaitTime: 

1.     Login into em console i.e http://<IP>:<PORT>/em
2.     Expand SOA and right click on "soa-infra" and select SOA Administration -> BPEL Properties
3.     Click on "More BPEL configuration Properties..." link
4.     Locate syncMaxWaitTime and increase the time value.

Setting the global transaction timeout at weblogic domain

1.     Log into Oracle WebLogic Administration Console.
2.     Click Services -> JTA.   
3.     Change the value of Timeout Seconds (the default is 30).
4.      Click Save.
5.      Restart Oracle WebLogic Server.

Note: For more information please follow the document Doc ID1524757.1  and Doc ID 880313.1 on oracle support.

How to avoid BPEL errors due to adapters response time

If BPEL adapter response is slow then you may notice follwing error in the container logfile from ORACLE_HOME\opmn\logs\.

ORABPEL-05002
ORABPEL-02182
JTA transaction is not present the transaction is not in active state
Message handle error


Cause:
The adapter response time is greater than the predefined waiting time for a BPEL instance, therefore the BPEL instance does not get dehydrated in due time and fails by throwing above mentioned errors.

Solution:
Option I
Explicitely dehydrate your BPEL instance before invoking the adapter.
This can be done by inserting a Java_embedded activity before the Invoke, with this tiny java code: checkpoint();. This will dehydrate the BPEL instance after its initiation without waiting it to complete And you will see it in the BPEL Console in pending status(waiting for the adapter response).

Option II
Increase the transaction timeout values in order to make the BPEL instance to wait more time until a response returns from the adapter.

Step I: Go to Oracle_Home\j2ee\\config\transaction-manager.xml and set transaction-timeout for example to 7200 or more (default is 30).

Step II: Go to Oracle_Home\j2ee\\application-deployments\orabpel\ejb_ob_engine\orion-ejb-jar.xmla and set all transaction-timeout to 3600 or more (but less than value set in step I)

Step III: Go to Oracle_Home\bpel\domains\\config\domain.xml and set syncMaxWaitTime to 240 or more (but less than above 3600, step II, current default is 45)

Step IV (Optional): Add following properties to the partnerlink in your BPEL project, in order to make the adapter retriable:

retryInterval --30
retryMaxCount -- 20

Step V: Redeploy the BPEL project

Step VI: Restart SOA server & verify.