• 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

Context close

 
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi one our application we have MDB Bean,

In the ejbCreate I found JMS connection is bind to context object something like this.

ctx.bind(jndiName, MQQueueConnectionFactory);
ctx.bind(queueJndiName, Queue);

Then context is closed by calling the close method.

ejbRemove is kept empty.

In the effort to clean the code (MQ open connection reported in production) we are in the process of closing the MQ connection which are not in use.

Since the scope of queue object is only with in the ejbCreate. Is it valid to close the MQ connection before closing the context?

I am relativity new in the subject, any help would be highly appreciated.


Thanks
Arun
[ March 11, 2008: Message edited by: Arun Boraiah ]
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

----------------------
In the ejbCreate I found JMS connection is bind to context object something like this.
ctx.bind(jndiName, MQQueueConnectionFactory);
ctx.bind(queueJndiName, Queue);
----------------------------------------------------------------
I gues you are using MQ as foreign JMS server..
Actually the connection is not bound in the context object. The above code just adds the connectionfactory and queue objects into the jndi tree. These objects are just object representation of queue with out actual connection (MQ queue in case your Messaging middleware is IBM MQ) and connectionafactory (MQ queue manager). When MDB gets deployed the bean makes connection to the MQ queue manager.(hope I am reasonably correct here)
Therefore closing of the MQ Conection does not have any relation with the context.
Closing of MQ connection will not remove the jndi bindings for the queue and connectionfactory.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic