[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
Wed Apr 25 17:56:21 EDT 2007


I have executed the whole testsuite and I didn't see any failures related to transactional behaviors.

And regarding to ACKs, I believe we should treat ACK on XA the as nonTransacted/AutoAck.

For this, we would have to probably change SessionAspect::handlePreDeliver:


  |       if (ackMode == Session.CLIENT_ACKNOWLEDGE)
  |       {
  |          // We collect acknowledgments in the list
  |          
  |          if (trace) { log.trace(this + " added to CLIENT_ACKNOWLEDGE list delivery " + info); }
  |          
  |          // Sanity check
  |          if (info.getConnectionConsumerSession() != null)
  |          {
  |             throw new IllegalStateException(
  |                "CLIENT_ACKNOWLEDGE cannot be used with a connection consumer");
  |          }
  |                   
  |          state.getClientAckList().add(info);
  |       }
  |       else if (ackMode == Session.AUTO_ACKNOWLEDGE ||
  |               (state.isXA() && (state.getCurrentTxId() instanceof LocalTx)))
  |       {
  | 

and postDeliver:

   public Object handlePostDeliver(Invocation invocation) throws Throwable
  |    { 
  |       MethodInvocation mi = (MethodInvocation)invocation;
  |       SessionState state = getState(invocation);
  |       
  |       int ackMode = state.getAcknowledgeMode();
  | 
  |       // if XA and there is no transaction enlisted on XA we will act as AutoAcknowledge      
  |       if (ackMode == Session.AUTO_ACKNOWLEDGE ||
  |          (state.isXA() && state.getCurrentTxId() instanceof LocalTx))
  |       {
  |  


What is weird though is, I have written an integration testcase, where a message was received inside an EJB, and it looked like the message was ACKed even though I didn't have a transaction to commit it. I know Tim tried to explain me how this would work but now I got confused.

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

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



More information about the jboss-dev-forums mailing list