• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Context close  RSS feed

 
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
What's that smell? I think this tiny ad may have stepped in something.
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!