3 Replies Latest reply on Jan 20, 2011 8:58 AM by veitg

    Mutable Objects inside ObjectMessage and rollback behaviour.

      Hi,

      with JBM shipped with JBossAS 5.1.0, i suspect that ObjectMessage body instances are cached.
      In a transaction I modify my object issued from ObjectMessage.getObject(), then something goes wrong and I do rollback on the JMS session.
      When the broker send the message a second time I get the same instance as the first failed receive with modifications made on my object in the previous failed transaction, It is not what I expect.
      So my question is : is this normal behaviour?
      Can I disable this cache and have everything rollbacked and my object deserialized again?

      Thank you for your help.

        • 1. Re: Mutable Objects inside ObjectMessage and rollback behavi
          gaohoward

          Hi,

          You can try to set RedeliveryDelay attribute in your destination configuration file to be something greater than zero.

          Howard

          • 2. Re: Mutable Objects inside ObjectMessage and rollback behavi

            Hi,

            thank you very much, instance are now recreated with RedeliveryDelay greater than 0.

            But is it a normal feature?

            David.

            • 3. Re: Mutable Objects inside ObjectMessage and rollback behavi
              veitg

              Hi.

               

              Sorry to dig this old thread out, but I have the same issue reported with JBoss 5.1.0. Changing the RedeliveryDelay to > 0 fixed it for me too.

               

              To answer your question: according to the jms 1.1 spec (3.10. "Changing the Value of a Received Message"), this is not expected behavior:

               

              "If the consumer modifies a received message, and the message is subsequently redelivered, the

              redelivered message must be the original, unmodified message (except for headers and properties

              modified by the JMS provider as a result of the redelivery, such as the JMSRedelivered header and

              the JMSXDeliveryCount property)."

               

              @JBM-developers: will this be fixed in a 1.x release in the near future? Or maybe it's enough to set RedeliveryDelay to 1 per default?!

               

              Thanks.