Thread: Driver 9.1 Connection does not have a registered XAResource
I downloaded an installed PostgreSQL 9.1 and am using it in a XA transaction (with an Oracle 11 database). The Transaction Manager is Atomikos. When connecting to the PostgreSQL db (and enlisting it in the transaction) I get the following stacktrace:
INFO: Connection does not have a registered XAResource jdbc:postgresql://X.X.X.X:5432/postgres?loginTimeout=0&socketTimeout=0&prepareThreshold=5&unknownLength=2147483647&loglevel=0&tcpkeepalive=false, UserName=myuserid, PostgreSQL Native Driver
java.sql.SQLException: Connection does not have a registered XAResource jdbc:postgresql://X.X.X.X:5432/postgres?loginTimeout=0&socketTimeout=0&prepareThreshold=5&unknownLength=2147483647&loglevel=0&tcpkeepalive=false, UserName=myuserid, PostgreSQL Native Driver
at org.apache.commons.dbcp.managed.TransactionRegistry.getXAResource(TransactionRegistry.java:78)
at org.apache.commons.dbcp.managed.TransactionContext.setSharedConnection(TransactionContext.java:88)
at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:131)
at org.apache.commons.dbcp.managed.ManagedConnection.<init>(ManagedConnection.java:55)
at org.apache.commons.dbcp.managed.ManagedDataSource.getConnection(ManagedDataSource.java:77)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
This happens with the "9.1-901 JDBC 4" and "9.0-802 JDBC 4" drivers, but connecting to my 9.1 database with the "8.4-703 JDBC 4" driver works perfectly. Did the behavior somehow change in 9.x? Do I (or the transaction manager) have to do something differently or is this a bug?
Thanks,
-Jason
INFO: Connection does not have a registered XAResource jdbc:postgresql://X.X.X.X:5432/postgres?loginTimeout=0&socketTimeout=0&prepareThreshold=5&unknownLength=2147483647&loglevel=0&tcpkeepalive=false, UserName=myuserid, PostgreSQL Native Driver
java.sql.SQLException: Connection does not have a registered XAResource jdbc:postgresql://X.X.X.X:5432/postgres?loginTimeout=0&socketTimeout=0&prepareThreshold=5&unknownLength=2147483647&loglevel=0&tcpkeepalive=false, UserName=myuserid, PostgreSQL Native Driver
at org.apache.commons.dbcp.managed.TransactionRegistry.getXAResource(TransactionRegistry.java:78)
at org.apache.commons.dbcp.managed.TransactionContext.setSharedConnection(TransactionContext.java:88)
at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:131)
at org.apache.commons.dbcp.managed.ManagedConnection.<init>(ManagedConnection.java:55)
at org.apache.commons.dbcp.managed.ManagedDataSource.getConnection(ManagedDataSource.java:77)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
This happens with the "9.1-901 JDBC 4" and "9.0-802 JDBC 4" drivers, but connecting to my 9.1 database with the "8.4-703 JDBC 4" driver works perfectly. Did the behavior somehow change in 9.x? Do I (or the transaction manager) have to do something differently or is this a bug?
Thanks,
-Jason