Glassfish database connection leak caused by jms exception
I'm using Glassfish v2.1.1, MySQL 5.1 and ActiveMQ 5.4.2 incl. its resource adapter. If t开发者_如何学JAVAhe ActiveMQ resource adapter throws an exception when participating in a XATransaction including both a database and jms transaction then glassfish will contain a transaction in rollback state which doesn't release its database connection to the database connection pool. These transactions will pile up and eventually saturate the database connection pool.
What happens here and how can I prevent these transactions to stall in the rollback state hanging on to the database connections?
Best regards Trym
Glassfish provides, in the admin console panel reated to any connector connection pool, "leak reclaim" which will reclaim leaked connection after a certain timeout (also defined in this connector properties) ... and output a stack trace each time a connection has been leaked.
You can also take a look at that question I asked about the very same JMS connection pool issue.
精彩评论