1. glassfish
  2. GLASSFISH-20821

JMS connection pool issue when used from timer bean


    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: v3.0.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:


      We found an issue when using JMS from a timer bean. Attached is a simplified program from what we use. A timer bean periodically checks on some task to execute. The result can be the execution of none, one or more tasks. Each task should be executed in a new transaction as the time out method is annotated not to use transactions.

      When the task is finished a message is pushed into a JMS queue. However, when there are a lot of tasks to execute (more then the pool size) the connection pool runs out of connections. This is strange as after each transaction the connection should be put back. Standard JMS is code is used. The message logged is

      WARNING: RAR5117 : Failed to obtain/create connection from connection pool [ jms/InputQueueFactoryPool ]. Reason : com.sun.appserv.connectors.internal.api.PoolingException: In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connections.

      The strange thing however is, when the JMS is used in the same code, but then from a Synchronization using TransactionSynchronizationRegistry all is fine. This can be enabled in the code removing the comments from (and then comment the 'sendToProcessingQueue' line. Also using the code from a servlet or REST resource is fine.

      This happens with GF 3.0.1 and

      To reproduce build attached sources and deploy. The timer bean kicks in after two minutes trying to put 50 messages in a queue where 32 connections are available in the queue. Embedded JMS is used here. The application configures itself using a resource description XML and requires no database.

      Is it the way of using the transaction attribute, jms or what?


        sisirhc added a comment -

        Where can I attached files? Please provide your mail address so I can send it to you.

        sisirhc added a comment - Where can I attached files? Please provide your mail address so I can send it to you.


          • Assignee:
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: