How to create a XA aware connection factory
fredk Feb 19, 2010 11:29 AMHi,
Currently I have a connection factory that supports local transactions, but since I need to connect to another database I have to transform it to a XA aware factory.
I changed my resource adapter configuration to support XATransactions, changed my custom factory class to extend org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory
and my changed my xa-ds.xml as attached.
After deploying the code on JBoss 5.1.0.GA
This is the error message:
16:43:51 WARN [main] JBossManagedConnectionPool.warn(363) Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Ongeldige Oracle-URL opgegeven.: OracleDataSource.makeURL)
at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:465)
at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:409)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:633)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:679)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:381)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
at nl.xa.OracleWrapperDataSource.getConnection(OracleWrapperDataSource.java:45)
...
...
(BTW translation 'Ongeldige Oracle-URL opgegeven' is about the same as 'Passed invalid Oracle-URL')
I tried to change 'ConnectionURL' to 'URL' and to 'URLProperty' but those won't work either. What am I doing wrong.
-
xa-ds.xml 1.4 KB