glassfish
  1. glassfish
  2. GLASSFISH-20349

Unable to create JMS transacted session in ExecutorService threads

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 3.1.2.2
    • Fix Version/s: None
    • Component/s: ejb_container
    • Labels:
      None
    • Environment:

      GF 3.1.2.2, Windows, single server environment (not clustered)

      Description

      There is a SLSB which makes use of ExecutorService to run an arbitrary number of threads.
      Each thread connects to JMS and acts as message consumer.

      In the SLBS:

      <code>
      ExecutorService executors = Executors.newCachedThreadPool();
      executors.submit(daemon); // daemon is an instance of Runnable
      </code>

      Inside the Runnable's run method, we attempt to create a JMS transacted session:

      <code>
      this.connection = this.connectionFactory.createConnection();
      this.connection.start();
      this.session = this.connection.createSession(true, Session.SESSION_TRANSACTED);
      this.messageConsumer = this.session.createConsumer(this.queue);
      </code>

      The problem is when the code above is executed, a non-transacted JMS session is created and acknowledgement mode is DUPS_OK_ACKNOWLEDGE.

      The SLSB which actually creates the threads by calling ExecutorService uses container manager transaction, transaction attribute is set to REQUIRED but these settings do not seem to have any effect.

      Thanks for your feedback.

        Activity

          People

          • Assignee:
            marina vatkina
            Reporter:
            novaks
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: