Monday, March 19, 2012

GetActiveUnitOfWork in JCA DbAdapter in Polling batching mode

We were getting this error:



com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/POSTXMLBatchPOC/Adapter/InsertIntoBatchOrders [ InsertIntoBatchOrders_ptt::InsertIntoBatchOrders(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'InsertIntoBatchOrders' failed due to: Could not create/access the TopLink Session.
This session is used to connect to the datastore.
Caused by java.lang.NullPointerException.
; nested exception is:
BINDING.JCA-11622
Could not create/access the TopLink Session.
This session is used to connect to the datastore.
Caused by java.lang.NullPointerException.
You may need to configure the connection settings in the deployment descriptor (i.e. DbAdapter.rar#META-INF/weblogic-ra.xml) and restart the server. This exception is considered not retriable, likely due to a modelling mistake.




Setting the property GetActiveUnitOfWork to false fixed the issue.

The official Oracle doc says:

GetActiveUnitOfWork is an advanced setting that forces all invoke activities in the same global transaction to use the same SQL connection if going to the same database. This makes it easier to guarantee that later invoke activities can see the changes of earlier invoke activities, but you may not need to set this at all (if using emulated two-phase commit, it should automatically be the same connection). Another difference is that for MERGE and INSERT, all changes are not written until the global transaction commits, so this setting also changes the timing of when WRITE operations occur.



The Datasource driver is a oracle.jdbc.xa.client.OracleXADataSource.... in the DbAdapter the Datasource ConnectionFactory is set with the xADataSourceName....

No comments: