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:


14 comments:

Anonymous said...

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

Andrej Baranovskij said...

Yes, exactly.

Andrejus

Unknown 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.

Andrej Baranovskij said...

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

Andrejus

Unknown 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.

Andrej Baranovskij 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

Unknown said...

Hello Andrejus,

we also use OracleXADataSource and also received the same error during rollback.
Shay recommended to use OracleXADataSource at
https://blogs.oracle.com/shay/entry/deploying_oracle_adf_applications_to, so we configured XA.
So should we use oracle.jdbc.OracleDriver?

Andrej Baranovskij said...

Hi,

XA driver is not supported with ADF, as per ADF documentation referenced above. With WebLogic it for sure requires oracle.jdbc.OracleDriver

With Glassfish I was not testing, but I think also better to use oracle.jdbc.OracleDriver, as same ADF libraries are used.

Regards,
Andrejus

Unknown said...

Hi Andrejus,
Thanks for this post. What is your suggestion about the Transaction options? Does it have anything to do with Task Flow's transaction options?
Thanks,
Ashwini

Andrej Baranovskij said...

I think is unrelated.

Andrejus

Francesco Savino said...

Then Fusion/ADF apps cannot partecipate in distrubuted transaction ? it should be a big limitation , what if I need to create a BC involved in XA transaction ?

Andrej Baranovskij said...

What would be the practical use case?

Regards,
Andrejus

Srinivas Achanta said...

Hi Andrjus,

We are using BPM UI developed with ADF and deployed on SOA server where BPM Composites are also deployed. We are seeing some abnormal exceptions during Roll Backs and Datsource Health is going to warning mode.

Can you please advise whether we have to Non XA for BPM UI Code as it is ADF to avoid these kind of Exceptions.


Thanks
Srinivas

Karthik said...

Hi Andrejus,
Should the Unique ID generator AM: ROWIDAM_DB be created as an XA / non-XA data-source?

Regards
Karthik