Thursday, May 31, 2012

Don't Use Oracle's Driver (Thin XA) to Define WebLogic Data Source for ADF Applications

In recent days/weeks I'm getting multiple requests with questions of following type: I have a problem with the rollback, I'm working with weblogic 10.3.6. In my application back when I do a rollback, but at the launch of the back gives me this error - java.sql.SQLException: Statement cancelled, probably by transaction timing out and similar. People are facing this issue when they move application to production or test server, on development environment embedded WebLogic everything works fine.

But really this is not an issue at all. What happens is - WebLogic administrators define wrong data source (XA data source). Error is not reproduced on embedded WebLogic, because data source is created automatically for you in development environment. XA data source should be never user with ADF/Fusion applications because it closes all cursors upon commit. Read more here from ADF developer guide - 41.3.7 What You May Need to Know About JDBC Data Source for Oracle WebLogic Server.

Make sure to select proper driver for Instance Connections:


6 comments:

Stephen J. said...

so this would be oracle.jdbc.OracleDriver as opposed to oracle.jdbc.xa.client.OracleXADataSource?

Andrejus Baranovskis said...

Yes, exactly.

Andrejus

Christopher Kovacs said...

I note that your document reference is to 11.1.2. Does this warning apply to 11.1.1 as well? I do not see a similar reference in the 11g R1 documentation.

Andrejus Baranovskis said...

This applies to all ADF versions, even starting from early 11g or even 10g. Yes, document was only recently updated.

Andrejus

Christopher Kovacs said...

Thanks Andrejus! FYI, we're big fans of yours. Keep up the excellent work!

This may be a bit off topic, but would this apply to DBAdapters as well? We've seen issues using a non-XA data source as a polling adapter initiator for a SOA composite application.

Andrejus Baranovskis said...

Thanks a lot for good feedback :)

Not sure about SOA DBAdapters, I guess some SOA data sources need to use XA datasource. This recommendation is only for Fusion Apps.

Andrejus