8 Replies Latest reply on Jan 22, 2005 7:21 AM by Arnold Fung

    JMS Connection pooling???

    Emre Mater Newbie

      Hi All,

      Is there a concept of JMS connection pooling like JDBC connection pooling? I'd appreciated if some idea about the subject below:

      Suppose that:

      I have a bussiness delegate XXXDelegate class which opens a JMS connection to a JBossMQ and put some messages to the sample queue XQueue.

      This delegate has a Singleton getInstance() method which returns a new instance of this XXXDelegate.

      public static XXXDelegate getInstance() {
      if (instance == null) {
      instance = new UserManagerDelegate();
      }
      return instance;
      }


      Again this delegate has a static doJob() method which opens the JMS connection and put messages to the queue.

      public static void doJob() {
      // open jms connection
      // put a message to a queue on JBoss Queue
      }


      In a servlet when someone pushes a submit button command below is executed.

      XXXDelegate.getInstance().doJob();

      Now, how is the difference between these two below:
      If a servlet from web tier calls this delegate only once and let's say concurrent 20 calls occurs.

      Is that mean, 20 new jms connections will be opened or because of singleton getInstance() method just one connection will be opened and others will wait for the first one to finish its job.

      Thanks for any help