Bob McWhirter [
http://community.jboss.org/people/bob.mcwhirter] created the discussion
"Difficulty with XA-DS deployment and UserTransaction"
To view the discussion, visit:
http://community.jboss.org/message/628086#628086
--------------------------------------------------------------
Within TorqueBox (based on AS7), we're deploying XA datasources based on information
contained within a user's deployment.
We are successfully getting the JDBC Driver (and InstalledDriver) loaded and installed, I
think.
We're leveraging the AS7 XaDataSourceService in our own DeploymentUnitProcessor to
deploy the datasource, and also doing all the BinderService stuff to get it into JNDI,
which also seems to work.
When we deploy an H2 XA DS, happiness abounds.
When we deploy a Postgres XA DS, we see this seemingly harmless stack in our logs:
12:15:08,030 ERROR [stderr] (MSC service thread 1-8) java.sql.SQLException:
UserTransaction -- service jboss.naming.context.java.UserTransaction
12:15:08,030 ERROR [stderr] (MSC service thread 1-8) at
org.jboss.jca.adapters.jdbc.WrapperDataSource.initUserTransaction(WrapperDataSource.java:266)
12:15:08,030 ERROR [stderr] (MSC service thread 1-8) at
org.jboss.jca.adapters.jdbc.WrapperDataSource.checkTransactionActive(WrapperDataSource.java:222)
12:15:08,031 ERROR [stderr] (MSC service thread 1-8) at
org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransactionActive(WrappedConnection.java:1577)
12:15:08,031 ERROR [stderr] (MSC service thread 1-8) at
org.jboss.jca.adapters.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:1592)
12:15:08,031 ERROR [stderr] (MSC service thread 1-8) at
org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:1566)
12:15:08,031 ERROR [stderr] (MSC service thread 1-8) at
org.jboss.jca.adapters.jdbc.WrappedConnection.getMetaData(WrappedConnection.java:813)
12:15:08,031 ERROR [stderr] (MSC service thread 1-8) at
arjdbc.jdbc.RubyJdbcConnection.set_native_database_types(RubyJdbcConnection.java:517)
Poking through the code, I see AS7DataSourceDeployer calling:
managedConnectionFactory.setUserTransactionJndiName("java:comp/UserTransaction");
So I'm confused by the lookup the WrapperDataSource is making, which doesn't seem
to be "java:comp/UserTransaction".
Also, while poking, it seems this whole code-path might only be executed for non-XA
DataSource deployments, and if we are trying to deploy XA data-sources, and are getting
here, then something's gone wrong.
Our DeploymentUnitProcessor which sets up the Service<T> for drivers, datasources
and all the JNDI binders is here:
https://github.com/torquebox/torquebox/blob/2x-dev/modules/core/src/main/...
https://github.com/torquebox/torquebox/blob/2x-dev/modules/core/src/main/...
I feel like I've missed some service, dependency, or configuration to get this
functioning.
Thanks for your help.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/628086#628086]
Start a new discussion in IronJacamar Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]