5 Replies Latest reply on Feb 28, 2005 7:45 AM by amdonov

    HAJMS Newbie

    amdonov Newbie

      Is it possible to get the transaction behavior of java:/JmsXA with HAJMS?

        • 1. Re: HAJMS Newbie
          Adrian Brock Master

          Yes, that is the default behaviour in the server/all configuration.
          Any failover of the jms server during a transaction will result in transaction rollbacks
          which you can catch and retry.

          • 2. Re: HAJMS Newbie
            amdonov Newbie

            Thanks for your reply. I'm glad enlisting HAJMS in transactions is possible, and I have successfully tested our MDB's but I'm a little confused regarding session beans.

            1. My understanding is that for JMS to be treated as a manged resource it has to be listed in your deployment desciptor and looked up via java:comp/env, and I thought you had to look up HAJMS using HAJNDI which can't see java:comp can it?

            2. In your response, you said if failover occurs exceptions may be caught. Should a new lookup be performed if publishing a message fails due to HA Singleton moving, or is it legal to register session beans as exception listeners?

            • 3. Re: HAJMS Newbie
              Adrian Brock Master

              You don't seem to understand how Managed environments work.
              There is lots of wrapping to protect you from having to deal with
              the real resources and the "book keeping" involved

              When you look up java:/JmsXA (or an alias of this using java:comp)
              you are not talking directly to the jms provider.

              You are talking to a pool that manages the underlying jms connections.

              The pool may not be able to satisfy your requests due to underlying failures
              (i.e. transaction rollback) but that is only for that request.
              The pool spots the failure and creates new connections internally
              for later requests (if that is possible).

              It is impossible to make failures transparent within a transaction. It is the nature
              of a transaction that they have state that cannot be recovered.

              • 4. Re: HAJMS Newbie
                Adrian Brock Master

                In more detail

                1) The real jndi access is done by the jms provider mbean (not the ejb)
                see (hajndi-)jms-ds.xml

                2) No, read the j2ee spec, the pool handles this.

                • 5. Re: HAJMS Newbie
                  amdonov Newbie

                  Thanks for your reply. It really cleared things up for me. The reason I thought I had to do the lookups myself using HA-JNDI is because topic lookups failed unless I used HA-JNDI. Final question I swear, just so I'm clear.
                  1) Lookup up java:/JmsXA through default initial context, lookup topic up through HA-JNDI.
                  2) I can cache JmsXA because it will handle failover for me.
                  3) Can I cache the topic lookup, or will it become invalid after node failure?

                  Thanks Again!