wtorek, sierpnia 19, 2014

Oracle AQ XA Connection

There is a bug in aqapi.jar AQjmsGeneralDBConnection which prevents usage of XA outside Oracle WebLogic.

Here is a bugfix:

private String getProviderKey() throws JMSException {
try {
OracleConnection oracleconnection = (OracleConnection) m_dbConn;
+ if (oracleconnection==null)
+ oracleconnection = (OracleConnection) m_xaConn.getConnection();
String s = oracleconnection.getURL();
int i = s.indexOf('@');
String s1;
if (i < 0) {
if (!"jdbc:oracle:kprb:".equals(((Object) (s)))
&& !"jdbc:default:connection:".equals(((Object) (s))))
AQjmsError.throwEx(112);
s1 = "jdbc:oracle:kprb:";
} else {
s1 = s.substring(i);
}
return s1.toUpperCase();
} catch (SQLException sqlexception) {
throw new AQjmsException(sqlexception);
}
}

oracle.jms.traceLevel=6
oracle.jms.useNativeXA=true
oracle.jms.useEmulatedXA=false
oracle.jms.j2eeCompliant=true

execute dbms_aqadm.create_queue_table(queue_table => 'XA.JMS_Q_STORE001', queue_payload_type => 'sys.aq$_jms_message', multiple_consumers => false);
execute dbms_aqadm.create_queue(queue_name => 'XA.test_fw1', queue_table => 'XA.JMS_Q_STORE001');
execute dbms_aqadm.start_queue('XA.test_fw1')
@ActivationConfigProperty(propertyName = "destination", propertyValue = "Queues/test_fw1"),

0 komentarze: