title: EJBException: Failed to acquire the pool semaphore
body: <p>I'm occasionally getting the following EJB exception across several different message driven beans:</p>
  
  <pre><code>javax.ejb.EJBException: Failed to acquire the pool semaphore, strictTimeout=10000
  </code></pre>
  
  <p>This behavior closely corresponds to when a particular database is having issues and thereby increases the amount of time spent in the MDB's onMessage function. The messages are being delivered by an ActiveMQ broker (version 5.4.2). The prefetch on the MDBs is 2000 (20 Sessions x 100 Messages per session). </p>
  
  <p>My question is a general one. What exactly is happening here? I know that a message which has been delivered to the server running the MDB will time out after 10 seconds if there is no instance in the bean pool to handle it, however how has that message been delivered to the server in the first place? My assumption up to this point is that the MDB requests messages from the broker in the quantity of  only when it no longer has any messages to process. Are they simply waiting in that server-side "bucket" for too long?</p>
  
  <p>Has anyone else run into this? Suggestions for tuning prefetch/semaphore timeout?</p>
  
  <p><strong>EDIT:</strong> Forgot to mention I'm using JBoss AS 5.1.0</p>