Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JMS/AQ + XA does not work?

545577Nov 13 2006 — edited Nov 14 2006
Hi,

We are trying to configure AQ for XA/JMS access, which does not seem to work. The problem is that the connection seems to think it is in local transaction mode when this is not true.

What we do is the following:

private static void testXA() throws Exception
{
String user = ...;
String pw = ...;
oracle.jdbc.xa.client.OracleXADataSource xads = new oracle.jdbc.xa.client.OracleXADataSource();
xads.setUser ( user );
xads.setPassword( pw );
xads.setURL("jdbc:oracle:thin:@//...");
XAQueueConnectionFactory cf = AQjmsFactory.getXAQueueConnectionFactory (
xads
);
XAQueueConnection c = cf.createXAQueueConnection ( user , pw );
AQjmsXASession s = ( AQjmsXASession ) c.createXAQueueSession();
XAResource xares = s.getXAResource();
OraXidFactory xidf = new OraXidFactory();
String bname = System.currentTimeMillis() + "";
Xid xid = xidf.createXid ( bname , bname );
xares.start ( xid , XAResource.TMNOFLAGS );
c.close();

}

When we run this, we get the following error:

Exception in thread "main" javax.transaction.xa.XAException
at oracle.jdbc.xa.OracleXAResource.disallowLocalTxnMode(OracleXAResource.java:1045)
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:153)
at oracle.jms.AQjmsXAResource.start(AQjmsXAResource.java:440)
at orajmstest.OraJmsTest.testXA(OraJmsTest.java:60)
at orajmstest.OraJmsTest.main(OraJmsTest.java:158)

The debugger shows that the corresponding oracle connection thinks it is in LOCAL transaction mode, which is the cause of this exception. The XAException has errorcode -6.

Note that we did setup the database for XA (JDBC/XA works, it is just the JMS that fails).

Any help or suggestions welcome...

Thanks,
Guy
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 12 2006
Added on Nov 13 2006
1 comment
1,514 views