• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help of XA

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
was version: 6.0
Implementation class name of "Oracle JDBC Driver" : oracle.jdbc.xa.client.OracleXADataSource

EJB->DAO:

When running the italic lines, there are below exceptions:
DSRA9350E: Operation Connection.commit is not allowed during a global transaction.
DSRA9350E: Operation Connection.rollback is not allowed during a global transaction.

How to modify? As someone mentioned, just comment the italic lines, but how to commit or rollback db transaction?

Otherwise, why is there no problem in weblogic?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you are using a XADatasource in a managed environment, the app server takes care of committing and rolling back the transactions in which this XADatasource participates. In your case the XA datasource is being used in a EJB transaction. Your application is not supposed to commit/rollback the database transaction.
 
Mike Sever
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, but the same version of source codes in weblogic has no such problem, any reason?
(At least, when creating connection pool in weblogic, "Implementation class name" of "Oracle JDBC Driver" can not be set anywhere.)
 
Mike Sever
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In weblogic, there is only such set:
"Driver Classname racle.jdbc.driver.OracleDriver".
 
Mike Sever
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Driver Classname: oracle.jdbc.driver.OracleDriver
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In that case, i guess Weblogic is not using the XA Oracle Datasource. It might be using non-XA datasource.

(At least, when creating connection pool in weblogic, "Implementation class name" of "Oracle JDBC Driver" can not be set anywhere.)



I havent worked with Weblogic, but i do think there will be some way of setting this implementation class name of the driver.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In weblogic, there is only such set:
"Driver Classname: Oracle.jdbc.driver.OracleDriver".



That explains the reason why you are not seeing the error message when you are using connection.commit in the code deployed on Weblogic
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Havent completely read this article, but see if its of any use to you for specifying the driver name in Weblogic:

Using third party JDBC driver in Weblogic
 
Mike Sever
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

That explains the reason why you are not seeing the error message when you are using connection.commit in the code deployed on Weblogic


In weblogic, anyway, it can run EJB->DAO well with one phase driver although don't know how...since you're familiar with was, I can only use XA and UserTransaction in EJB.

In websphere, if using one phase driver class "oracle.jdbc.pool.OracleConnectionPoolDataSource", there will be below exception:
javax.resource.ResourceException: java.sql.SQLException: enlist: caught Exception

"oracle.jdbc.driver.OracleDriver" and "oracle.jdbc.OracleDriver" (which mentioned in the weblogic link provided by you) can not be set in websphere because there is below exception when "Test connection":
Test connection failed for data source xxxx on server xxxxsvr at node xxxxnode with the following exception: java.lang.Exception: DSRA8101E: DataSource class cannot be used as one-phase: ClassCastException: oracle.jdbc.driver.OracleDriver, error code: NOT_A_1_PHASE_DS. View JVM logs for further details.

Otherwise, is there any differece between "Data sources" and "Data sources (Version 4)", I'm using "Data sources" (EJB 2.0), is it ok?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic