title: DB2 Driver Connection Hanging in Glassfish Connection Pool
body: <p>We have an intermittent issue around the DB2 used from a Glassfish connection pool. What happens is this:</p>
  
  <p>Under situations where the database (DB2 on ZOS) is under stress, our application (which is a multi-threaded application using connections to DB2 via a Glassfish connection pool) stops doing anything.</p>
  
  <p>The following are observed:</p>
  
  <p>1) Looking at the server using JConsole, we can see a thread waiting indefinitely in the DB2 driver's getConnection() method. We can also see that it has gained a lock on a Vector within the driver. Several other threads are also calling the getConnection() method in the driver, and are hanging waiting for the lock on the Vector to be released.</p>
  
  <p>2) Looking at the database itself, we can see that there are connections from the Glassfish server open and waiting to be used. It seems that there is some sort of mismatch between the connection pool on Glassfish and the connections actually open to DB2.</p>
  
  <p>Has anyone come across this issue before? Or something similar? If you need any more information that I haven't provided, then please let me know!</p>