1 Reply Latest reply on Jun 19, 2003 4:47 PM by adrian.brock

    Publish Mesg from SessBean -- Good Idea?

    rkbeach


      Hi All,

      Is it a good idea to use a Session Bean to publish messages to a Topic? Assuming the Topic is in the same context...not a remote Topic...

      The reason I am asking this question is...currently, I am using a SessionBean to publish messages to a Topic...but, in my SessionBean I have to lookup a ConnectionFactory, creating a connection, session etc., everytime....

      Or is there a way to cache these objects and not look them up everytime....

      Does anyone have any experience with this?

      Regards,
      Srini

        • 1. Re: Publish Mesg from SessBean -- Good Idea?

          Use the connection factory java:/JmsXA
          it provides pooling of java:/XAConnectionFactory
          the in vm connection factory.

          NOTE: It also enrolls the JMS XAResource in your
          ejb transaction so the message is not sent
          until the EJB transaction commits.

          Regards,
          Adrian