Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS connection factory  RSS feed

 
Balamaci Serban
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • 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?
 
Osuwari Inu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!