Tuesday, March 27, 2012

Cannot call rollback when using distributed transactions


If you are using an XA datasource, you may get the following exception:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
         <faultstring>Exception occured when binding was invoked.
Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.insert failed. Descriptor name: [MyDB.AhmedXaTest].
Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions.
Please see the logs for the full DBAdapter logging output prior to this exception.  This exception is considered retriable, likely due to a communication failure.  To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml).  To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff.  All properties are integers.
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.</faultstring>
            <exception>Cannot call rollback when using distributed transactions</exception>


This is because your datasource was in the wrong location. Since you created an XA datasource, it must be the appropriate property in your connection factory.

1. Login to the WebLogic Admin Console.

2. Navigate to Deployments > DbAdapter > Configuration.

3. Expand javax.resource.cci.ConnectionFactory and click on your connection factor (e.g., eis/DB/AhmedXA).

4. Make sure that xaDataSourceName has your datasource.

5. Save.

6. Click on Deployments.

7. Check the checkbox beside 'DbAdapter', then click on the 'Update' button.

8. Click on 'Finish'.

9. Activate the changes.

For non-XA datasources, check out http://blog.ipnweb.com/2011/08/jca-binding-execute-of-reference.html.

Applicable Versions:
  • Oracle SOA Suite 11g (

Ahmed Aboulnaga

No comments: