• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

JMS connection factory

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need that inside a MDB to send the received message to multiple queues. So i need to start a new connection to another JMS server.
I read that there is quite an overhead with starting a conection to a jms server, that it implies authentification, and such... looking up the connection factory in the jndi server... The connection is supossed to be multithreaded anyway. So how about we make the connection as static variable, something like in the HomeFactory pattern. Calling start on an already started connection does not get any errors. After finishing up with the message processing, we don;t close the connection and all the beans get to use the same connection? How about that?
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd advise against using static variables in any J2EE application. It's a sure way to undermine scalability and caching in the server.
You could try to create a connection in the ejbCreate method of the MDB and release the connection in the ejbRemove.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic