Causing onMessage in MDB to rollback

          Is it possible for a pub/sub MDB to "unconsume" a message? I have successfully
          rolled back a message consumed by a point-to-point MDB, but not one consumed by
          a pub/sub MDB.
          I am using WLS 7.0 and MQ 5.3. My deployment descriptor specifies container management
          and durable subscriber
          The logic for the p2P and pub/sub MDBs is similar. The onMessage rejects every
          other message (based on a static member counter), either via context.setRollbackOnly()
          or throwing an EJBException (I've tried implementing both). For pub/sub, I have
          2 MDBs, the second MDB accepts all messages. In p2p, when a message is rejected,
          it is re-consumed by the next bean that the container instantiates. In pub/sub
          a message that is accepted by bean 1 is also read by bean 2. A message that is
          rejected by bean 1 is read by bean 2, but bean 1 does not retry, indicating that
          the message was not returned to the topic for bean 1.
          Am I missing something, or is it not possible to return a message to a topic once
          a subscribing MDB has retrieved it?
          TIA,
          Ed
          

One thing is that you are not running transactionally. In order to
          get transactions, "onMessage()" for each MDB needs to be set to
          "Required":
          <assembly-descriptor>
          <container-transaction>
          <method>
          <ejb-name>exampleMessageDrivenA</ejb-name>
          <method-name>onMessage()</method-name>
          </method>
          <trans-attribute>Required</trans-attribute>
          </container-transaction>
          </assembly-descriptor>
          Ed Trembicki-Guy wrote:
          > Thanks Tom. Here are the descriptor files:
          >
          > ejb-jar.xml:
          >
          > <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
          > 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
          >
          > <!-- Generated XML! -->
          >
          > <ejb-jar>
          > <enterprise-beans>
          > <message-driven>
          > <ejb-name>PTPMsgBean</ejb-name>
          > <ejb-class>com.roxy.ejb.WLMsgBean</ejb-class>
          > <transaction-type>Container</transaction-type>
          > <message-driven-destination>
          > <destination-type>javax.jms.Queue</destination-type>
          > </message-driven-destination>
          >
          > </message-driven>
          > <message-driven>
          > <ejb-name>PubSubMsgBean</ejb-name>
          > <ejb-class>com.roxy.ejb.WLPubSubMsgBean</ejb-class>
          > <transaction-type>Container</transaction-type>
          > <message-driven-destination>
          > <destination-type>javax.jms.Topic</destination-type>
          > <subscription-durability>Durable</subscription-durability>
          > </message-driven-destination>
          >
          > </message-driven>
          > <message-driven>
          > <ejb-name>PubSubMsgBean2</ejb-name>
          > <ejb-class>com.roxy.ejb.WLPubSubMsgBean2</ejb-class>
          > <transaction-type>Container</transaction-type>
          > <message-driven-destination>
          > <destination-type>javax.jms.Topic</destination-type>
          > <subscription-durability>Durable</subscription-durability>
          > </message-driven-destination>
          >
          > </message-driven>
          > </enterprise-beans>
          >
          > </ejb-jar>
          >
          > <?xml version="1.0" encoding="UTF-8"?>
          > <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN'
          > 'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
          >
          > weblogic-ejb-jar.xml:
          >
          > <!-- Generated XML! -->
          >
          > <weblogic-ejb-jar>
          > <weblogic-enterprise-bean>
          > <ejb-name>PTPMsgBean</ejb-name>
          > <message-driven-descriptor>
          > <pool>
          > <max-beans-in-free-pool>1</max-beans-in-free-pool>
          > <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
          > </pool>
          >
          > <destination-jndi-name>mqQ</destination-jndi-name>
          > <connection-factory-jndi-name>mqQCF</connection-factory-jndi-name>
          > </message-driven-descriptor>
          >
          > </weblogic-enterprise-bean>
          > <weblogic-enterprise-bean>
          > <ejb-name>PubSubMsgBean</ejb-name>
          > <message-driven-descriptor>
          > <pool>
          > <max-beans-in-free-pool>1</max-beans-in-free-pool>
          > <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
          > </pool>
          >
          > <destination-jndi-name>mqT</destination-jndi-name>
          > <connection-factory-jndi-name>mqTCF</connection-factory-jndi-name>
          > </message-driven-descriptor>
          >
          > </weblogic-enterprise-bean>
          > <weblogic-enterprise-bean>
          > <ejb-name>PubSubMsgBean2</ejb-name>
          > <message-driven-descriptor>
          > <pool>
          > <max-beans-in-free-pool>1</max-beans-in-free-pool>
          > <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
          > </pool>
          >
          > <destination-jndi-name>mqT</destination-jndi-name>
          > <connection-factory-jndi-name>mqTCF</connection-factory-jndi-name>
          > </message-driven-descriptor>
          >
          > </weblogic-enterprise-bean>
          > </weblogic-ejb-jar>
          >
          > Tom Barnes <[email protected]> wrote:
          >
          >>Hi Ed,
          >>
          >>It should be possible, but with one caveat: If the
          >>subscriber is non-durable, then a JMS vendor has the option
          >>of simply "forgetting" or "dropping" a message on
          >>a rollback. WL JMS does not do this (we think
          >>this behavior makes nondurable less useful), but
          >>IBM JMS may. Actually, the JMS spec specifically gives
          >>vendors the option of arbitrarily dropping
          >>pub/sub messages to nondurable subscribers for
          >>ANY reason, and a few vendors take advantage of this.
          >>
          >>Anyhow, if you post your descriptor xml files I'll
          >>take a quick look.
          >>
          >>You may want to try a test with WL JMS as the topic
          >>provider to see if that narrows the problem down
          >>to something in MQ or possibly something in the WL
          >>container "foreign vendor" integration code.
          >>
          >>Tom
          >>
          >>Ed Trembicki-Guy wrote:
          >>
          >>
          >>>Is it possible for a pub/sub MDB to "unconsume" a message? I have
          >>
          >>successfully
          >>
          >>>rolled back a message consumed by a point-to-point MDB, but not one
          >>
          >>consumed by
          >>
          >>>a pub/sub MDB.
          >>>
          >>>I am using WLS 7.0 and MQ 5.3. My deployment descriptor specifies
          >>
          >>container management
          >>
          >>>and durable subscriber
          >>>
          >>>The logic for the p2P and pub/sub MDBs is similar. The onMessage rejects
          >>
          >>every
          >>
          >>>other message (based on a static member counter), either via context.setRollbackOnly()
          >>>or throwing an EJBException (I've tried implementing both). For pub/sub,
          >>
          >>I have
          >>
          >>>2 MDBs, the second MDB accepts all messages. In p2p, when a message
          >>
          >>is rejected,
          >>
          >>>it is re-consumed by the next bean that the container instantiates.
          >>
          >>In pub/sub
          >>
          >>>a message that is accepted by bean 1 is also read by bean 2. A message
          >>
          >>that is
          >>
          >>>rejected by bean 1 is read by bean 2, but bean 1 does not retry, indicating
          >>
          >>that
          >>
          >>>the message was not returned to the topic for bean 1.
          >>>
          >>>Am I missing something, or is it not possible to return a message to
          >>
          >>a topic once
          >>
          >>>a subscribing MDB has retrieved it?
          >>>
          >>>TIA,
          >>>Ed
          >>>
          >>
          >
          

Similar Messages

  • Reg MDB transaction rollback

    i have an MDB deployed on weblogic 8.1 sp6 server. My confusion here is how the MDB handles transaction rollbacks. E.g suppose if the MDB is designed to do the below action.
    1) read an xml message from a jms queue
    2) insert some database records
    3) generate some xml message, post it to some other jms queue
    suppose if step 1 and 2 is completed, and its on step 3, at this point weblogic server shutdowns suddenly, once i restart the server, it reads the xml message again from the jms queue, but this time it errors out, because it finds the data already entered in step 2.
    My question is when the weblogic server shut down while the mdb was at step 3, why didnt it removed all the db entries it made in step 2. This behaviour apears to me as partial rollback. I have given the mdb descriptor below.
    <ejb-jar>
      <enterprise-beans>
        <message-driven>
          <ejb-name>CSS_Response</ejb-name>
          <ejb-class>com.bt.neo.core.utility.appcontroller.transport.mdb.JmsMessageReceiver</ejb-class>
          <transaction-type>Container</transaction-type>
          <acknowledge-mode>auto-acknowledge</acknowledge-mode>
          <message-driven-destination>
            <destination-type>javax.jms.Queue</destination-type>
          </message-driven-destination>
          <env-entry>
            <env-entry-name>ejb/BeanFactoryPath</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>core-css-response-inbound.xml</env-entry-value>
          </env-entry>
          <env-entry>
            <env-entry-name>ProcessorBeanName</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>transportAdaptor</env-entry-value>
          </env-entry>
          <resource-ref>
            <res-ref-name>jms/faultTo</res-ref-name>
            <res-type>javax.jms.Destination</res-type>
            <res-auth>Container</res-auth>
          </resource-ref>
        </message-driven>
      </enterprise-beans>
      <assembly-descriptor>
        <container-transaction>
          <method>
            <ejb-name>CSS_Response</ejb-name>
            <method-name>onMessage</method-name>
            <method-params>
              <method-param>javax.jms.Message</method-param>
            </method-params>
          </method>
          <trans-attribute>Required</trans-attribute>
        </container-transaction>
      </assembly-descriptor>
    </ejb-jar>Please clear my doubt.
    Edited by: Deepak Dev on 19-Dec-2011 11:01

    General information on message-driven beans can be found here: http://docs.oracle.com/cd/E12840_01/wls/docs103/ejb/message_beans.html
    To transaction configuration is discussed here: http://docs.oracle.com/cd/E12840_01/wls/docs103/ejb/message_beans.html#wp1162058
    Looks like you have to set the transaction-type to Container and the trans-attribute to required. Also see the note:
    - However, if you make this configuration error, the MDB will not run transactionally—if a failure occurs mid-transaction, updates that occurred prior to the failure will not be rolled back.

  • JMS MDB manual rollback possible ?

    Hi,
    I want to know if it's possible to manually roll back a message if something goes wrong ?
    I have a Message Driven Bean that receives a message and sends it over http to another component. Now I want to make sure that my message isn't lost. So in case of an http timeout I want the message to be put back on the queue in front of following messages.
    As I read before, a message is removed from its JMS Queue in case the onMessage method of the bean completes, so in my code
    public void onMessage(Message message){
    try{
    //send message over http
    }catch(Exception e){
    //this is where I want the message to be roll-backed
    As it is now, if there is an http timeout, an axception will be catched, but the onmessage method will still be executed successfully, and the message will be removed from the queue, result, a loss of the message.
    is this possible with standard jms ?
    kind regards
    Bert

    It is certainly possible, but it depends on how your application is working.
    if you are working with beans: No problem, just set the MessageDrivenContext.SetRollBackOnly() -> rolls back the transaction! (in case of Container managed transaction), if you are using your own transactions, simply roll them back your self.
    If you are not using beans, you simply do not acknowledge your message, for JMS a message needs to be acknowledged before it assumes that it is delivered. So set your ACK_MODE to CLIENT_ACKNOWLEDGE and in case of an exception do not acknowledge it, otherwise, do acknowledge it.
    Since you are using a MDB the first solution should be used in your case.

  • MDB rollbacks and stops the listener port with error code 2072

    Hi
    We have a MDB listening on QUEUE1. This MDB processes the message and puts another message in QUEUE2. Transaction is "required" for this MDB.
    The processing could somtime take more than 2 min. We used to get EJB timeout error in this scenario. We changed EJB timeout to 5 min (default was 2 min). This resolved the timeout error. But it started throwing following exception. Note that if the processing takes less than 2 min, MDB never rollbacks.
    After this rollack, listener port can not pick up the next message and it throws error (MQJMS2002: failed to get message from MQ queue. MQ Error Code 2072) . It stops as a result and restarts after 60 sec. Even after restart it can not process the messages till we restart the JVM.
    Regarding error handling, Backout threshold is 3. If the message is redelivered, we discard this message.
    We are using 2 Phase commit for 2 resources MQ (5.3) and MS SQL.
    Websphere version is 5.1.
    Two issues here
    1. Why is MDB rolling back if processing takes more than 2 min.
    2. After the rollback, why is listener port not picking up the messages. Why do we need to recycle the JVM.
    Any pointers to resolve this issue?
    EXCEPTION
    [11/29/05 15:03:37:752 EST] 1b9bccc XATransaction E J2CA0027E: An exception occurred while invoking end on an XA Resource Adapter from dataSource JMS$postprocessor$JMSManagedConnection@25078403, within transaction ID {XID: formatId(57415344), gtrid_length(51), bqual_length(2, data(00000000000000950000000113238145f813eccfef12249c6aab206666f96901636c5f6170703130355f73656e7431715f716113238145f813eccfef12249c6aab206666f969010000000100000000)}: javax.transaction.xa.XAException: XA operation failed, see errorCode
    at com.ibm.mq.MQXAResource.end(MQXAResource.java:520)
    at com.ibm.ejs.jms.JMSManagedSession$JMSXAResource.end(JMSManagedSession.java:1557)
    at com.ibm.ejs.j2c.XATransactionWrapper.end(XATransactionWrapper.java:525)
    at com.ibm.ws.Transaction.JTA.JTAResourceBase.end(JTAResourceBase.java:253)
    at com.ibm.ws.Transaction.JTA.RegisteredResources.distributeEnd(RegisteredResources.java:629)
    at com.ibm.ws.Transaction.JTA.TransactionImpl.internalPrepare(TransactionImpl.java:1241)
    at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:981)
    at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:150)
    at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:177)
    at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:712)
    at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:167)
    at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:570)
    at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3068)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:102)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
    at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:375)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912)
    [11/29/05 15:03:38:089 EST] 1b9bccc ServerSession W WMSG0031E: Exception processing JMS Message for MDB BatchProcessorMDB, JMSDestination jms/PostprocessorQ : javax.ejb.TransactionRolledbackLocalException: ; nested exception is: com.ibm.ws.exception.WsEJBException
    com.ibm.ws.exception.WsEJBException
    at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapException(LocalExceptionMappingStrategy.java:159)
    at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapCSITransactionRolledBackException(LocalExceptionMappingStrategy.java:293)
    at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3159)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:102)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
    at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:375)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912)
    javax.ejb.TransactionRolledbackLocalException: ; nested exception is: com.ibm.ws.exception.WsEJBException
    at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapCSIException(LocalExceptionMappingStrategy.java:96)
    at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapException(LocalExceptionMappingStrategy.java:165)
    at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapCSITransactionRolledBackException(LocalExceptionMappingStrategy.java:293)
    at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3159)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:102)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
    at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:375)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912)
    [11/29/05 15:03:38:124 EST] 1e9aa18 JMSExceptionL E WMSG0018E: Error on JMSConnection for MDB BatchProcessorMDB , JMSDestination jms/PostprocessorQ : javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue
    at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:553)
    at com.ibm.mq.jms.MQSession.consume(MQSession.java:3144)
    at com.ibm.mq.jms.MQSession.run(MQSession.java:1585)
    at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:924)
    at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:752)
    at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:527)
    at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:494)
    at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:37)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:91)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
    at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:375)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912)
    ---- Begin backtrace for Nested Throwables
    com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2072
    at com.ibm.mq.jms.MQSession.consume(MQSession.java:3118)
    at com.ibm.mq.jms.MQSession.run(MQSession.java:1585)
    at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:924)
    at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:752)
    at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:527)
    at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:494)
    at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:37)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:91)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
    at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:375)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912)
    [11/29/05 15:03:38:149 EST] 1e9aa18 JMSExceptionL E WMSG0057E: Error on JMSConnection for MDB BatchProcessorMDB , JMSDestination jms/PostprocessorQ , JMS Linked Exception : com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2072
    at com.ibm.mq.jms.MQSession.consume(MQSession.java:3118)
    at com.ibm.mq.jms.MQSession.run(MQSession.java:1585)
    at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:924)
    at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:752)
    at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:527)
    at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:494)
    at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:37)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:91)
    at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
    at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:375)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912)
    [11/29/05 15:03:38:190 EST] 1e9aa18 MDBListenerIm I WMSG0043I: MDB Listener ProcessorLP stopped for JMSDestination jms/PostprocessorQ
    [11/29/05 15:03:38:192 EST] 1e9aa18 MDBListenerIm I WMSG0058I: Listener Port ProcessorLP will attempt to restart in 60 seconds
    [11/29/05 15:03:38:194 EST] 1e9aa18 ConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adaptor for resource jms/PostprocessorQF. The exception which was received is javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue
    [11/29/05 15:04:38:230 EST] 1436f66 MDBListenerIm I WMSG0042I: MDB Listener ProcessorLP started successfully for JMSDestination jms/PostprocessorQ

    Have been able to solve this problem? The same occurs in our environment. I have a nagging feelin git has something to do with a known bug that is solved in some fixpack or something. We're on Websphere 5.1.1.4.
    Any feedback would be appreciated.
    Thanks,
    Jaap

  • MDB multiple redelivery problem

    I use WL 6.1 SP2.
              I got MDB, wchich sometimes can process some operations on external
              systems (thru JCA), and it may last some time. It can also sleep,
              while one of the systems is down and post it again from MDB (not
              rollback, message will be modified) to the queue.
              The problem is that while waiting (sleep) to post message, after
              several seconds (about 30) the original message is processed again in
              another MDB, and so on, so in result i have very many messages in the
              queue, instead of one wchich should be processed many times.
              I tried
              <transaction-descriptor>
              <trans-timeout-seconds>120</trans-timeout-seconds>
              </transaction-descriptor>
              in MDB, but it didn't help.
              What can I do to stop it?
              

    Lukasz Borycki wrote:
              > I use WL 6.1 SP2.
              > I got MDB, wchich sometimes can process some operations on external
              > systems (thru JCA), and it may last some time. It can also sleep,
              > while one of the systems is down and post it again from MDB (not
              > rollback, message will be modified) to the queue.
              > The problem is that while waiting (sleep) to post message, after
              > several seconds (about 30) the original message is processed again in
              > another MDB, and so on, so in result i have very many messages in the
              > queue,
              There is only one message in the queue, it is just that you
              are getting transaction timeouts. As soon as the transaction
              times-out it is as if the dequeue and the MDB operations
              never occurred, so the message is redelivered. Meanwhile
              your particular app continues to hold a defunct copy
              of the message and continues to work while not knowing that any
              work it does will get rolled back.
              > instead of one wchich should be processed many times.
              > I tried
              > <transaction-descriptor>
              > <trans-timeout-seconds>120</trans-timeout-seconds>
              > </transaction-descriptor>
              > in MDB, but it didn't help.
              > What can I do to stop it?
              I think there was a bug that caused MDBs ignore the descriptor
              trans-timeout-descriptor value, at least
              in some versions. Contact customer support to see if this is fixed in a
              SP
              or if there is a patch, or, alternatively, post to the ejb newsgroup.
              Meanwhile, you
              can modify the default transaction timeout for the entire domain from its
              current value
              of 30 seconds. The default tx timeout is configured on the console under
              "domain->jta->timeout seconds".
              Tom
              

  • MDB is not fired when message in Topic

    Hi,
              Weblogic 7.0.2.0
              remote Weblogic 7.0.2.0
              I have a MDB that is listening to a remote topic.
              The deployment is ok, and when I monitor the MDB in the weblogic console
              the connection Alive is true, so is connecting and listening to the
              remote Topic.
              The problem I am having is that when the remote Topic receives a message
              the MDB's onMessage method is not called.
              I would appreciate any help on this.
              Publius
              

    It is pretty likely there is some basic misconfiguration. As I wrote
              earlier, if there are no problems in the log file, please post
              your config.xml and MDB descriptor xml files and I (or someone)
              will take a look.
              Tom
              Ruowei Wu wrote:
              > The log file is fine until the message is published, which means the onMessage()
              > in MDB doesn't receive anything, but publish doesn't have any exception.
              >
              >
              > Tom Barnes <[email protected]> wrote:
              >
              >>The same advice applies. The first place to look is in your log files.
              >>
              >>Ruowei Wu wrote:
              >>
              >>>we have exactly same problem, message post is fine, but MDB doesn't
              >>
              >>receive anything,
              >>
              >>>looks like mdb container doesn't deliver.
              >>>
              >>>
              >>>Tom Barnes <[email protected]> wrote:
              >>>
              >>>
              >>>>Check for warnings and error messages in your log, as an MDB can
              >>>>still deploy successfully even if it fails to create its JMS connection.
              >>>>The MDB container will just keep retrying to connect.
              >>>>
              >>>>If this doesn't help, please post your MDB descriptor files and
              >>>>I'll take a look.
              >>>>
              >>>>Tom, BEA
              >>>>
              >>>>Publius Ismanescu wrote:
              >>>>
              >>>>
              >>>>>Hi,
              >>>>>
              >>>>>
              >>>>>Weblogic 7.0.2.0
              >>>>>remote Weblogic 7.0.2.0
              >>>>>
              >>>>>
              >>>>>I have a MDB that is listening to a remote topic.
              >>>>>The deployment is ok, and when I monitor the MDB in the weblogic console
              >>>>
              >>>>>the connection Alive is true, so is connecting and listening to the
              >>>>
              >>>>>remote Topic.
              >>>>>
              >>>>>The problem I am having is that when the remote Topic receives a message
              >>>>
              >>>>>the MDB's onMessage method is not called.
              >>>>>
              >>>>>I would appreciate any help on this.
              >>>>>
              >>>>>Publius
              >>>>>
              >>>>
              >
              

  • Stop MDB from listening to a JMS queue

    Hello,
    From time to time we would like to stop the processing done in our application.
    The processing is started by onMessage() in MDB. Is it possible to tell the MDB
    to stop listening
    to the JMS queue or stop the delivery of messages by JMS ? We do not intent to
    stop the processing of messages that have already started by only to stop processing
    of further messages (the ones still in the JMS queue).
    We are using 6.1SP3.
    Any help is appreciated.
    Eric Poupaert,
    Approach Belgium SA.

    If you can tune the number of messages that should be sent to the MDB to 0, that would
    temporarily stop the MDB from consuming messages. Thsi is the "Messages maximum"
    parameter on ur connectionfactory. WL6 doesnt support changing this value to 0 but there
    were some newsgroup discussions last year that it might be supported in a future
    release. Maybe its fixed in 8?
    Eric Poupaert wrote:
    Hello,
    From time to time we would like to stop the processing done in our application.
    The processing is started by onMessage() in MDB. Is it possible to tell the MDB
    to stop listening
    to the JMS queue or stop the delivery of messages by JMS ? We do not intent to
    stop the processing of messages that have already started by only to stop processing
    of further messages (the ones still in the JMS queue).
    We are using 6.1SP3.
    Any help is appreciated.
    Eric Poupaert,
    Approach Belgium SA.

  • Re: Constant Message Redelivery Problem

    You can get redelivery for other reasons as well. Redelivery occurs if the message is
              participating in a transaction, and the transaction fails for any reason.
              For example, if the MDB in turn calls an EJB which in
              turn calls JDBC then the tx becomes two-phase. If the JDBC call fails then the tx
              will roll back. Or if the tx times-out: the default tx timeout is 30 seconds, so if
              the MDB takes longer than 30 seconds then the tx will roll-back and message the will
              get redelivered.
              Even if the tx succeeds, in some cases you may have error states that re-enqueue the
              received message but let the transaction commit (WLI, BEA's integration product, can do
              this).
              This looks like the redelivery of a failed message, but is actually the delivery of a new
              version.
              Duplicates occur if a Queue MDB's descriptor actually points at a topic destination.
              Check for this one by comparing the JNDI name in config.xml against the
              descriptor destination type field...
              Tom
              sunshine wrote:
              > I encountered the same problem of repeat message delivery. In our situation, we are
              > using JMS JDBC Store and when the database goes down and comes back up, the MDB starts
              > processing messages but the messages keep recycling in the JMS Store.
              >
              > The MDB code tried catching all possible exceptions like RuntimeException and Exception.
              > None of these exceptions are logged. When we re-start the WL managed servers, those
              > messages in the JMS Store were flushed off.
              >
              > Any idea what caused the repeat message redelivery?? Thanks.
              >
              > Tom Barnes <[email protected]> wrote:
              > >Your MDB may be throwing a RuntimeException, which forces message
              > >redelivery. Put a try/catch/Throwable in the outermost scope of your
              > >onMessage() code to see if this is case.
              > >
              > >Note that in 6.1 and up you can configure redelivery delays, max redelivery
              > >counts and error destinations to alleviate this problem...
              > >
              > >Tom
              > >
              > >Toad wrote:
              > >
              > >> I have a message-driven bean listening on a message queue and everything
              > >> appears to work the first time the message is sent. The message is processed
              > >> and the OnMessage method returns without incident. There are no errors
              > >and
              > >> no exceptions are thrown by the JMS client or in the MDB itself. PROBLEM:
              > >> Message continually redelivered pegging the CPU at 100%. Inspection of
              > >the
              > >> JMSSTORE and JMSSTATE reveals messages still queued. Any ideas?
              > >
              

    And make sure that your MDB is not throwing Errors or RuntimeExceptions,
              as these don't necessarily get logged, but they cause rollbacks.
              Put a "try {} catch (RuntimeException re)
              { log; throw re; } catch (Error er) { log; throw er; }"
              around all the code within the MDB's "onMessage()" callback
              to see if this is happening.
              Manikyala Peddi wrote:
              > Hi,
              >
              > I have a MDB which is calling an EJB. The redelivery override period was set at 60 sec.
              >
              > Before completing the first message the same message is redelivered.The processing time in onMessage in MDB takes more than the Redelivery Override Period. Is there a way to prevent the delivery of the duplicate message before completing the first message.Iam using Weblogic 7.1
              >
              > Thanks
              >
              > Manikyala
              

  • PXT messsage

    Have a pre-paid sim card from Crazy Johns in a 3G iPhone and when receiving an MMS, comes upo with a blurb about PXT message sent, have to go to a web server quoting the code to retrieve it. Vodafone wont discuss it, Crazy Johns say its an Apple issue.
    Does anyone lknow if there is a way these MMS images can be displayed directly in the message rather than mucking around with PXT retrieval?
    Same phone worked perfectly well with a Virgin post-paid sim.
    Thanks,
    Rosti.

    We had a simmilar looking stacktrace with weblogic 12.1.1.
    In our case it was caused by an MDB with looked like:
    class OurMDB implements javax.jms.MessageListener, OurConst {
        public void onMessage(Message msg) {
    }OurConst is an interface with only constants.
    It deployed on weblogic 11 but not on weblogic 12.1.1
    When i removed the OurConst and used static imports the bean deployed on weblogic 12.1.1.
    It smells like a bug but it worked in our case. (Took me some days to find out)

  • How to hightLight selected row in table with version 10.1.3 ADF

    Hi there
    I am experiencing a difficulty in getting the radio selected table row to be highlighted with 10.1.3 Jdeveloper.
    i had looked it an example from this blog --
    http://adf-rk.blogspot.com/2007/01/adf-oracle-form-like-overflow-in-adf.html
    it worked, but the problem is that it does highlight the table cell's data background , but it doesn't hightlight the whole row.
    can anyone have any idea of how to get the whole row working?

    By setting the server platform,
    <server-platform xsi:type="oc4j-1012-platform">
    </server-platform>
    you are enabling JTA integration and the external transaction controller. So if your data-source "jdbc/OracleDS" is a JTA datasource and the JTA transaction is being set to roll back then the insert should not get committed.
    Verify that you are not trapping the exception further up causing the SessionBean not to rollback the transaction. Also turn on TopLink logging to verify what is occurring.
    The active UnitOfWork uses the default connection pool, so your
    <name>NamedConnectionPool</name>
    is not required unless you are using it some other way?
    Also when using JTA "uow.commit();" is not required, the JTA transaction is responsible for committing the unit of work.

  • Insert and delete same record from database immediately

    Hi,
    I am using Tomcat 4.1.12 and Oracle 9i. Since there is no transaction management in tomcat, except via third party tools, i have to do the following to simulate transaction management :-
    insert a particular record
    <some other problem occured so must...>
    Delete the same record (which i just inserted)
    However, my record was not deleted even though there is no error thrown out. everything seems to work perfectly. Is it because i just inserted the record and then straight away deleted that's why the delete fails to delete ? I tried to setAutoCommit(false) and then commit in the delete method, but it fails. I also tried to commit after i delete, and again, it doesn't work.
    What's the remedy ?
    Thanks!

    if i am using a datasource, is that considered as a
    connection pool ? (I dont think so ? )
    Will the code work in Tomcat since there is no
    transaction management ? Thus, without transaction
    management(explicitly have a start transaction) will
    the concept of commit and rollback still be applicable
    ?Sorry for delay - I only pop into the forums occassionally.
    It seems to me that Tomcat is not your issue with regards to transaction management. You just need to manage transactions at the application level. A more relevant question is what DBMS are you using and does it support setAutoCommit, commit, or rollback using a JDBC connection?
    A connection on a datasource (DSN) is not a pool, but just a single connection. Many different threads/clients may want to use a connection to perform a transaction. You need to manage/control concurrency on your connection(s) to avoid a situation where 2 separate clients are using the same connection to perform transactions at the same time.
    The concept of commit and rollback are totally relevant here and have nothing to do with Tomcat, but with the underlying DBMS. If a client calls setAutoCommit, commit, or rollback, it will cause the DBMS commit or rollback all statements processed by the connection since the last commit. If 2 clients are using the same connection it is possibile that 1 client can accidentially commit or rollback another client's transaction.
    The jdk 1.4 javax.sql package contains classes that provide implementations for management of connection pools, although I have not used them yet as I have previously coded my own.

  • 3GS Bricks Itself After 4.2 Update

    Have a 3GS, previously running iOS 4.1. Upgraded to 4.2 today.
    Upgrade appeared to work fine. Was playing with the phone and its potential new features (what there are of them) and it just shut itself off. And it won't turn back on.
    Anyone else having this problem? Anyone have a solution (short of attempting to restore from backup and/or just get that iPhone 4 I've been meaning to buy)?
    Thanks.
    -Craig.

    roscop wrote:
    I also just made the 4.2 update on a 3GS and now having NO funtionality with any of my hard buttons (volume up/down, mute switch, and top sleep button).
    Did a full restore and still no resolution. Called apple and they have no other complaints.
    It must be the update! 3 sets of buttons all of a sudden don't work after the update.
    Apple needs to allow a version roll back option.
    It is not the version you updated to; it is the update process that caused the problem. A rollback wouldn't help because it would still corrupt the previous version during the update.
    Your symptoms are not ones I have seen before. Try a DFU restore on a different computer, or if you use the same computer use a USB port directly on the computer, disconnect all non-essential USB devices, disable your antivirus.
    See: http://support.apple.com/kb/HT1808

  • Commit after a select query

    Do we need to commit after a select statement in any case (in any transaction mode)?
    Why do we need to commit after selecting from a table from another databse using a DB link?
    If I execute a SQL query, does it really start a transaction in the database?
    I could not find any entry in v$transaction after executing a select statement which implies no transactions are started.
    Regards,
    Sandeep

    Welcome to the forum!
    >
    Do we need to commit after a select statement in any case (in any transaction mode)?
    >
    Yes you need to issue COMMIT or ROLLBACK but only if you issue a 'SELECT .... FOR UPDATE' because that locks the rows selected and they will remain locked until released. Other sessions trying to update one of your locked rows will hang until released or will get
    >
    ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
    >
    In DB2 a SELECT will create share locks on the rows and updates of those rows by other sessions could be blocked by the share locks. So there the custom is to COMMIT or ROLLBACK after a select.
    >
    Why do we need to commit after selecting from a table from another databse using a DB link
    >
    See Hooper's explanation of this at http://hoopercharles.wordpress.com/2010/01/27/neat-tricks/
    And see the 'Remote PL/SQL section of this - http://psoug.org/reference/db_link.html
    A quote from it
    >
    Why does it seem that a SELECT over a db_link requires a commit after execution ?
    Because it does! When Oracle performs a distributed SQL statement Oracle reserves an entry in the rollback segment area for the two-phase commit processing. This entry is held until the SQL statement is committed even if the SQL statement is a query.
    If the application code fails to issue a commit after the remote or distributed select statement then the rollback segment entry is not released. If the program stays connected to Oracle but goes inactive for a significant period of time (such as a daemon, wait for alert, wait for mailbox entry, etc...) then when Oracle needs to wrap around and reuse the extent, Oracle has to extend the rollback segment because the remote transaction is still holding its extent. This can result in the rollback segments extending to either their maximum extent limit or consuming all free space in the rbs tablespace even where there are no large transactions in the application. When the rollback segment tablespace is created using extendable files then the files can end up growing well beyond any reasonable size necessary to support the transaction load of the database. Developers are often unaware of the need to commit distributed queries and as a result often create distributed applications that cause, experience, or contribute to rollback segment related problems like ORA-01650 (unable to extend rollback). The requirement to commit distributed SQL exists even with automated undo management available with version 9 and newer. If the segment is busy with an uncommitted distributed transaction Oracle will either have to create a new undo segment to hold new transactions or extend an existing one. Eventually undo space could be exhausted, but prior to this it is likely that data would have to be discarded before the undo_retention period has expired.
    Note that per the Distributed manual that a remote SQL statement is one that references all its objects at a remote database so that the statement is sent to this site to be processed and only the result is returned to the submitting instance, while a distributed transaction is one that references objects at multiple databases. For the purposes of this FAQ there is no difference, as both need to commit after issuing any form of distributed query.

  • Oracle 10g database as Resource manager and heuristic transaction decision

    Hi,
    I have read in documents about distributed tarnsaction that resource manager like oracle databasecthat are involved in distributed transaction can take heuristic decision(unilateral decision) and can either rollback or commit the transaction associated with itself without having confirmation from the transaction manager.
    I want to know how a resource manager take this unilateral decision and can we set this as parameter either in resource manager or in application server.
    Thanks in advance

    Hi,
    Following are some links to documents.
    Handling Heuristic Completions
    http://edocs.bea.com/wls/docs81/ConsoleHelp/jta.html
    A heuristic completion (or heuristic decision) occurs when a resource makes a unilateral decision during the completion stage of a distributed transaction to commit or rollback updates. This can leave distributed data in an indeterminate state. Network failures or resource timeouts are possible causes for heuristic completion. In the event of an heuristic completion, one of the following heuristic outcome exceptions may be thrown:
    HeuristicRollback—one resource participating in a transaction decided to autonomously rollback its work, even though it agreed to prepare itself and wait for a commit decision. If the Transaction Manager decided to commit the transaction, the resource's heuristic rollback decision was incorrect, and might lead to an inconsistent outcome since other branches of the transaction were committed.
    HeuristicCommit—one resource participating in a transaction decided to autonomously commit its work, even though it agreed to prepare itself and wait for a commit decision. If the Transaction Manager decided to rollback the transaction, the resource's heuristic commit decision was incorrect, and might lead to an inconsistent outcome since other branches of the transaction were rolled back.
    HeuristicMixed—the Transaction Manager is aware that a transaction resulted in a mixed outcome, where some participating resources committed and some rolled back. The underlying cause was most likely heuristic rollback or heuristic commit decisions made by one or more of the participating resources.
    2. Understanding EJB Transaction
    http://www2.sys-con.com/itsg/virtualcd/Java/archives/0504/tyagi/index.html
    Unilateral Decisions
    The transaction manager allows certain heuristic or speculative decisions to be made based on the state of all participating resources in a transaction and the underlying two-phase commit protocol. A heuristic decision occurs when one of the resources in the transaction unilaterally decides to commit or roll back the transaction without permission from the transaction manager
    3. Oracle® Containers for J2EE
    http://download.oracle.com/docs/cd/B31017_01/web.1013/b28958.pdf
    Heuristics
    To achieve consensus, two-phase commit is a blocking protocol. This means that, if a coordinator fails before delivering the final phase messages, the participants must remain blocked, holding onto resources. Modern transaction systems add heuristics to two-phase commit, which allows such participants to make unilateral decisions about whether they will commit or rollback. If a participant makes a choice that turns out to be different from the one taken by other participants, then non-atomic behavior occurs.
    I got this problem while trying to do a distributed J2EE tarnsaction with two XA (one MQ and other Oracle 10g database XA) and one non-xa (oracle 10g database). According to above docs a resource manager can decide tarnsaction final state unilaterally and that can result in unatomic transaction.
    Do oracle also make such decision and if yes then on what ground it takes decision? Can we change this according to our requirement either always rollback/commit anywhere as parameter setting?
    Thanks

  • Applets just stopped working

    Java Applets just stopped working on my machine the other day. They now persistently give me a "Failed to Load" message that says "Applet notinited" in it.
    I've tried rolling back my machine before Tuesday's Windows Update, but it was VML-related, and probably not the cause of this (plus, the rollback probably would have fixed it if it were the cause). I also tried many different version of the JRE, and removed previous ones entirely before getting new ones. I've tried everything from the latest to older ones, and no luck.
    I searched for this error, and Sun points you to proxy settings. Since I have no proxy, and since only my laptop, and not my wife's behind the same router, is affected, I know it can't be that.
    Does anyone have any other clues? It's really annoying. And it seems to have happened completely out of the blue. I just can't use Applets any more. I changed no settings and messed with nothing. I'd hate to have to reinstall Windows just to fix Java.

    Hi, are you running a macmini Intel?
    Launch the Console app [ Applications/Utilities/Utilities folder] do you have any message there regarding Java, and what are they if any?
    I presume you have the latest Java updates, and have run your Software update to check?
    Do you have these showing in the Safari menu bar under Help>Installed plug ins:
    Java Plug-in for Cocoa
    Java 1.4.2_09 Plug-in (Cocoa) — from file “JavaPluginCocoa.bundle”.
    -------MIME------------Type Description--------Extensions
    Java Web Start Applications------application/x-java-jnlp-file---jnlp
    application/x-java-applet-------Basic Java Applets-----------javaapplet
    Did you recently update Java? see this from Apple.
    document
    IThank you!! The test account works. Now how to I fix my name account so it works, too?
    You are welcome; ) If that doesn't help any...since this is user name account specific problem ONLY,as the test account indicates, see if the advice from Hayne his is post count 7 helps you any. I think it is worth the effort, you may also.
    What does this Test tell you.
    Does this work work for you showing a wavy? moving line of text
    I don't know if any of this will help, I hope so. Good luck!
    Happy Holidays to all here!
    Eme'~[)
    p.s. Spindoctor sorry for your Java problems.
    create a new user account and all apps,
    No not new apps, just to see is the problem is system wide; )

Maybe you are looking for

  • [SOLVED] External USB mouse doesn't work

    I've installed Arch on my laptop and today faced with a problem. When I boot with AC off my external USB mouse doesn't work. Also it looks like USB ports don't work. If I detached AC when working mouse works fine. I can suppose there is some problem

  • How to make picture part of Excel and have siena take that image?

    Hi, I've got a gallery which is taking information from my excel sheet. It a name and picture column. For each name, I had image URL which directed to my pictures folder. (C:\C:\Users\exampleuser\Pictures\...). This worked really well. But I recently

  • How to find greater than for 2 values and post greater value in new cell

    I'm trying to compose a formula for a cell whereby the answer is the greater of 2 other cells.i.e. e4 and f4 are the reference cells and g4 should have the greater of the 2 values as the answer in that cell. Should be simple but cannot figure it out.

  • Error while connecting to DB's - java.lang.NullPointerException

    I am getting this error while connecting to any db using SQL dev. 1. I was able to connect to all before something happaned (unrealted install/uninstalls) 2. I also have two errors in the "Logging Page- Log" window I have seen this errors in other th

  • Using transaction-isolation tag

    Hi Anyone knows where the <transaction-isolation> tag must be setup in weblogic-ejb-jar.xml deployment descriptor ? The DTD contains the tag but the WLS 8.1 SP3 doesn't recognize it. Cheers ! Jin