[jboss-user] [JBoss Messaging] - Re: Sending Messages from EJB using container transaction

fs5@gmx.net do-not-reply at jboss.com
Tue Apr 7 05:18:45 EDT 2009


"eontech" wrote : 
  | 1. Which connection factory to use so that JMS uses Container transaction? Currently we are using /ConnectionFactory
  | 
java:/JmsXA

"eontech" wrote : 
  | 2. Do we need to open connection every time we send a message or we can have a connection object initialized in post construct of Session bean. Currently we create it at post construct of session EJB
  | 
>From a JMS point of view, the connection object is thread safe. It should therefore be safe to put it to an instance variable  of your EJB

"eontech" wrote : 
  | 3. Do we need to create session every time we send a message or we can have a session object initialized in post construct of Session bean. Currently we create it every time.
  | 
There is a correlation between session and transcation, furthermore the session object has not be thread-safe. So, you should create it for every transaction.

Kind regards,
Frank


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4223947#4223947

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4223947



More information about the jboss-user mailing list