[jboss-user] [JBoss Messaging] - javax.jmx.Session and XAConnectionFactory

ivan.rododendro do-not-reply at jboss.com
Tue Dec 16 04:08:56 EST 2008


Hello, 
we have a SLSB who register himself as producer of a topic, in post construct we create Conection, Session & Porducer, and in send() we call session.createObjectMessage(): 

 
  | @PostConstruct
  |     public void postConstruct() {
  |               try {
  |             connection = connectionFactory.createTopicConnection();
  |             session = connection.createSession(true, Session.SESSION_TRANSACTED);
  |             producer = session.createProducer(destination);
  |             producer.setTimeToLive(messageValidityPeriod * 60000);
  |         } catch (final JMSException e) {
  |             logger.error("unable to create JMS producer", e);
  |         }
  |     }	
  | 



public void send(final Map<String, String> properties, final ProvisioningEvent event) {
  |         try {
  |             final ObjectMessage message = session.createObjectMessage();
  | 
  |             message.setObject(event);
  |             
  |             [...]
  | 
  |             producer.send(message);
  |   
  |         } catch (final JMSException e) {
  |             if (logger.isInfoEnabled()) {
  |                 logger.info("JMSException: " + e.getMessage());
  |             }
  |         }
  |     }	
  | 

Connetction Factory is JmsXA. 

It worked in JBAS50-CR2 (JBM 1.4.1-CR1 ?), but with JBAS5.0-GA it does not work anymore: 

javax.jms.IllegalStateException: The session is closed

on calling session.createObjectMessage() in method send(). 

If the session is created in the method send, performances are really slowed down, due to a synchronization problem. 

Please help
Ivan


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

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



More information about the jboss-user mailing list