Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pooled Connections - EJB Shutdown

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a vendor framework that currently opens and closes an MQSeries connection for each request. We'd like to run a proof of concept pooling these connections to see if we get a useful performance gain. I have no problem making an object pool, but I'm concerned that at server shutdown we may leave a lot of connections open on the QueueManager end.

Is there a shutdown event in the EJB container that I can use as a trigger to close all the connections in my pool? Or a better idea entirely?

Do you know any specific MQ connection pooling solutions?

This is WebSphere 5.0.1, *not* Enterprise. I think some of this is built into the Enterprise version, but we're not there for some reason.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stan,

Without being a WAS expert I can provide you two hints: one is to use JMX and MBeans. I know you can develop listener classes that can listen for notification when the state of an MBean changes. For example you can locate any of the runtime MBeans and check whether the server is running or not. Another idea is to use a similar approach with the way the container implements connection pooling. In a nutshell you can write a simple method that checks if the connection is healthy and do the check in order to retrieve/return the connection to the pool. This way you can make sure that your clients get only available connections. I hope this will help.
Regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic