Announcement Announcement Module
Collapse
No announcement yet.
Sending Message to MQ is not participating in existing Weblogic transaction. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sending Message to MQ is not participating in existing Weblogic transaction.

    We are using MessageDrivenBean and have following transction properties,

    (a) transaction-type = "Container".
    (b) trans-timeout-seconds = "60"

    Note : We are using 2 PHASE Commit

    We have made sure that Oracle Driver is XA Enabled.
    And our MQ is also XA enabled (com.ibm.mq.jms.MQXAQueueConnectionFactory)


    We have following 3 activities in MDB

    1) Getting the message from MQ (OnMessage() is invoked)
    2) Calling Oracle Stored Procedure
    3) Sending XML message to another MQ Queue

    Sometimes, we have seen that the procedures takes around 93 seconds to respond.
    In that case, after getting back the control from procedure, ideally weblogic should issue a runtime exception,
    because we have specified transaction timeout to 60 seconds.

    Later, when container determines that transaction took more than 60 seconds, it issue a rollback.
    In that case, Step no. 1 & 2 is ROLLBACKED. Step-3 is NOT ROLLBACKED.

    Now, i have 2 questions,
    (a) Once we get control back from stored procedure after 93 seconds, why container doesn't throw
    runtime exception & issue transction rollback ?

    (b) Lets say, it doesn't, then how to enlist JMS Resource in existing weblogic transaction,
    so that, if the rollback happens, all 3 above steps should rollbacked.

    We are using SPRING Framework by looking up JmsTemplate102 object and calling "convertAndSend() method"


    <bean id="csmToIBus1" class="org.springframework.jms.core.JmsTemplate102 ">
    <property name="connectionFactory">
    <ref bean="jmsQueueConnectionFactory"/>
    </property>
    <property name="destinationResolver">
    <ref bean="jmsDestinationResolver"/>
    </property>
    <property name="pubSubDomain">
    <value>false</value>
    </property>
    <property name="defaultDestinationName">
    <value>QueueName1</value>
    </property>
    </bean>

    <bean id="jmsQueueConnectionFactory" class="org.springframework.jms.connection.SingleCo nnectionFactory102">
    <property name="targetConnectionFactory">
    <ref bean="internalJmsConnectionFactory"/>
    </property>
    <property name="pubSubDomain">
    <value>false</value>
    </property>
    </bean>

    <!-- JMS Destination Resolver -->
    <bean id="jmsDestinationResolver" class="org.springframework.jms.support.destination .JndiDestinationResolver">
    <property name="jndiTemplate">
    <ref bean="jndiTemplate"/>
    </property>
    <property name="cache">
    <value>true</value>
    </property>
    <property name="fallbackToDynamicDestination">
    <value>true</value>
    </property>
    </bean>

    <!-- Spring JMS Queue Connection Factory -->
    <bean id="internalJmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryB ean" lazy-init="true">
    <property name="jndiTemplate">
    <ref bean="jndiTemplate"/>
    </property>
    <property name="jndiName">
    <value>QCF1</value>
    </property>
    </bean>


    Any hints will be highly appreciated.

    Thanks,
    Shashi
Working...
X