• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pooled Connections - EJB Shutdown

 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic