[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Problem with Xa transactions in Oracle, Can anyone help me?

andresramilo do-not-reply at jboss.com
Tue May 26 07:57:05 EDT 2009


Hi,
Im trying to configure an application to work in Jboss, and I was unabled to do that.
the Aplication has two data sources called nmadmprod-ds.xml and portabilidad-ds.xml
Here is the source
nmadmprod-ds.xml:
<?xml version="1.0" encoding="UTF-8"?>

<xa-datasource>
<jndi-name>nmadmprodDS</jndi-name>
<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:oracle:thin:@chavalote.optare.loc:1521:optare</xa-datasource-property>
<xa-datasource-property name="User">nmadmprod</xa-datasource-property>
<xa-datasource-property name="Password">nmadmprod</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/>
<min-pool-size>5</min-pool-size>
<max-pool-size>11</max-pool-size>

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

<type-mapping>Oracle9i</type-mapping>



<depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager

</xa-datasource>


portabilidad-ds.xml:
<?xml version="1.0" encoding="UTF-8"?>

<xa-datasource>
<jndi-name>portabilidadDS</jndi-name>
<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:oracle:thin:@chavalote.optare.loc:1521:optare</xa-datasource-property>
<xa-datasource-property name="User">portabilidad</xa-datasource-property>
<xa-datasource-property name="Password">portabilidad</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/>
<min-pool-size>5</min-pool-size>
<max-pool-size>15</max-pool-size>

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

<type-mapping>Oracle9i</type-mapping>



<depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager

</xa-datasource>


When I deploy the aplication and it begin to work I get the following exception, here´s part of stack trace:

2009-04-23 16:28:07,593 WARN [org.jboss.resource.connectionmanager.TxConnectionManager] (pool-12-thread-1) Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener at 1c8dc85[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection at 5bd66 handles=0 lastUse=1240496885578 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool at a92a55 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool at 1a39f8 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection at 5bd66 txSync=null]
oracle.jdbc.xa.OracleXAException
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1223)
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:318)
at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:213)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:889)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:500) 


I´ve searching in google and read a lot of material in trying to configure Jboss 5.0.1.GA to work using the XA protocol with Oracle9i Enterprise Edition Release 9.2.0.8.0.
Most of material was about configure a Jboss 4 server.

Do i have to set pad=true in Jboss 5, if true where and how do i set that?
I try to add to jboss-service the following lines, doesnt work.
<!-- The configurable Xid factory. For use with Oracle, set pad to true -->

true

I try to add to transaction-service.xml and doesnt work. Even try to add true to the mbeans in this file and doesnt work.
Im using the thin driver and have ojdbc14.jar version of my database.
If change the Datasources to <xa-datasource-property name="URL">jdbc:oracle:oci8:@chavalote.optare.loc:1521:optare</xa-datasource-property> and use classes12.zip instead ojdbc14.jar the application works. But i see a bunch of configuration utilizing the thin driver. 


Any clue that could help me? Thanks in advance. 

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233287#4233287

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233287




More information about the jboss-user mailing list