[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Bug in transactional delivery in an MDB

clebert.suconic@jboss.com do-not-reply at jboss.com
Fri Apr 20 18:07:04 EDT 2007


I have found some inconsistences between JCA and Messaging.

It looks like JBossMQ would return a XAConnection only under certain circustances, and JBossMQFActory would take the decision wether the Connection should be XA or not.

And it happens that our Connection is aways a XA Connection


  |  public class JBossConnection implements
  |     Connection, QueueConnection, TopicConnection,
  |     XAConnection, XAQueueConnection, XATopicConnection, Serializable
  | 


So, looking at JCA Code, you have several places like this:




  | 
  | package org.jboss.resource.adapter.jms;
  | 
  | 
  | .....
  | 
  | public class JmsManagedConnection
  |    implements ManagedConnection, ExceptionListener
  | {
  | 
  | .....
  | 
  |    private void setup() throws ResourceException
  |    {
  | 
  |       ................
  | 
  |             if (con instanceof XATopicConnection)
  |             {
  |                xaTopicSession = ((XATopicConnection)con).createXATopicSession();
  |                topicSession = xaTopicSession.getTopicSession();
  |                xaTransacted = true;
  |             }
  |             else if (con instanceof TopicConnection)
  |             {
  |                topicSession =
  |                   ((TopicConnection)con).createTopicSession(transacted, ack);
  |                if (trace)
  |                   log.trace("Using a non-XA TopicConnection.  " +
  |                             "It will not be able to participate in a Global UOW");
  |             }
  |             else
  |                throw new JBossResourceException("Connection was not recognizable: " + con);
  | 
  |             if (trace)
  |                log.trace("xaTopicSession=" + xaTopicSession + ", topicSession=" + topicSession);
  |          }
  | 
  |       ................
  |    }
  | 
  | ......
  | }
  | 


If what I'm saying is correct (That the MQ.ConnectionFactory would take the decision on return a XAConnection or not), we have two options:

I - Refactor the JCA layer to be more compatible with our Messaging approach
II - Refactor Messaging to only return XAConnections when it's necessary.


Any thoughts?





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

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



More information about the jboss-dev-forums mailing list