Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XA DataSource configuration Error/Exception in JBoss

 
Baiju Varugese
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to user UserTransaction object, so i configured XADatasource in JBoss, the configuration details is given below.

<xa-datasource>

<jndi-name>OFWSource</jndi-name>
<track-connection-by-tx>true</track-connection-by-tx>
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc racle:thin:@localhost:1521:myuser</xa-datasource-property>
<xa-datasource-property name="User">scott</xa-datasource-property>
<xa-datasource-property name="Password">tiger</xa-datasource-property>

<!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
<!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
<!-- Checks the Oracle error codes and messages for fatal errors -->
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
<no-tx-separate-pools/>

<!-- sql to call when connection is created-->
<new-connection-sql>select * from er_user</new-connection-sql>


<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional)
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata> -->


When i tried to use the resource

initCtx = new InitialContext();
org.jboss.resource.adapter.jdbc.WrapperDataSource ds = (org.jboss.resource.adapter.jdbc.WrapperDataSource) initCtx.lookup(dataSource);
Connection connection = ds.getConnection();


i am getting following exception while using the connection object

Error while creating connection due to::: Could not enlist in transaction on entering meta-aware object!javax.transaction.SystemException: Could not get XAResource from ManagedConnection!javax.transaction.RollbackException: Already marked for rollback TransactionImpl:XidImpl[FormatId=257, GlobalId=BLR2-2F-006a/23, BranchQual=, localId=23]; - nested throwable: (javax.resource.ResourceException: Could not enlist in transaction on entering meta-aware object!javax.transaction.SystemException: Could not get XAResource from ManagedConnection!javax.transaction.RollbackException: Already marked for rollback TransactionImpl:XidImpl[FormatId=257, GlobalId=BLR2-2F-006a/23, BranchQual=, localId=23])

please help me

thanks
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm unclear on what an XA datasource has to do with UserTransaction, but the problem that you've probably run into is that you also need to configure the Xid padding in jboss-service.xml (in the conf directory).
 
Baiju Varugese
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thanks,

while using the local transaction datasoure i am getting a exception,

you cannot commit the user transcation. so i changed the datasource to xa datasource.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic