ISSUE:
While invoking BRM Opcode BPEL Process gets failed with below mentioned error:
java.lang.IllegalStateException: New ManagedConnection cannot be
created for a thread which is already in BRM transaction).
SOLUTION:
The JCA Resource Adapter does not support nested transactions.
In case of a BPEL Process invoking multiple opcode above mentioned error occurs.
To set up JCA Resource Adapter transaction management in BPEL, perform the following:
In the BPEL client, set these BPEL partnerLink properties:
cacheConnections=false
useJCAConnectionPool=true
Also make sure in the JCA Resource adapter, a private connection pool is created for the connection factory.
After modification bpel.xml should look like below.
<partnerLinkBinding name="BRMTXNService">
<property name="wsdlLocation">BRMTXNServiceRef.wsdl</property>
<property name="cacheConnections">false</property>
<property name="useJCAConnectionPool">true</property>
</partnerLinkBinding>
<partnerLinkBinding name="BRMBILLService">
<property name="wsdlLocation">BRMBillServiceRef.wsdl</property>
<property name="cacheConnections">false</property>
<property name="useJCAConnectionPool">true</property>
</partnerLinkBinding>