[jboss-user] [JCA/JBoss] - Re: 2 PersistenceUnits: Adding multiple last resources is di

baz do-not-reply at jboss.com
Tue Jul 17 02:32:05 EDT 2007


Now totally clueless. 
Found the example definition of an oracle XA datasource in the docs\examples\jca folder of JBOss As and adapted it:
  <xa-datasource>
  |     <jndi-name>Oracle</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:@172.31.10.32:1521:xe</xa-datasource-property>
  |     <xa-datasource-property name="User">eadb</xa-datasource-property>
  |     <xa-datasource-property name="Password">oracle</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-->
  |      <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
  |     <no-tx-separate-pools/>
  |    <!-- 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>
  | 
  |       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
  |       <metadata>
  |          <type-mapping>Oracle9i</type-mapping>
  |       </metadata>
  |   </xa-datasource>
  | 
  |   <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter" 
  |          name="jboss.jca:service=OracleXAExceptionFormatter">
  |     <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
  |   </mbean>
  | 
but this results in this exception:
08:20:32,745 INFO  [STDOUT] Hibernate: select experiment0_.ExperimentID as Experime1_76_, experiment0_.Size as Size76_, experiment0_.SowingYear as SowingYear76_, experiment0_.Description as Descript4_76_, experiment0_.HarvestYear as HarvestY5_76_, experiment0_.SowingDate as SowingDate76_, experiment0_.AddressCode as AddressC7_76_, experiment0_.AddressFAOCode as AddressF8_76_, experiment0_.PartnerCode as PartnerC9_76_, experiment0_.ProjectCode as Project10_76_, experiment0_.ExperimentCode as Experim11_76_, experiment0_.ExperimentName as Experim12_76_, experiment0_.SiteID as SiteID76_, experiment0_.HarvestDate as Harvest14_76_, experiment0_.Design as Design76_, experiment0_.Samples as Samples76_, experiment0_.Replications as Replica17_76_ from EXPERIMENT experiment0_ limit ?
  | 08:20:32,916 ERROR [XAManagedConnectionFactory] Start transaction failed for org.jboss.resource.adapter.jdbc.xa.XAManagedConnection at 1e3cf1f
  | 08:20:32,916 WARN  [TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener at 1e23cfc[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection at 1e3cf1f handles=0 lastUse=1184653232885 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool at 133066c context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool at eac619 xaResource=org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper at 11c55b txSync=null]
  | oracle.jdbc.xa.OracleXAException
  | 	at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1157)
  | 	at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:295)
  | 	at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:121)
  | 	at org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper.start(JcaXAResourceWrapper.java:113)
  | 	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:701)
  | 	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:446)
  | 	at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.enlist(TxConnectionManager.java:773)
  | 	at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:564)
  | 	at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:337)
  | 	at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:518)
  | 	at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:399)
  | 	at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
  | 	at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
  | 	at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
  | 	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
  | 	at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
  | 	at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
  | 
Can anyone tell me what is wrong?
And given the fact that XA is necessary, where to find an example for mysql?

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

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



More information about the jboss-user mailing list