You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by bs...@apache.org on 2010/11/08 19:19:23 UTC

svn commit: r1032658 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java

Author: bsnyder
Date: Mon Nov  8 18:19:23 2010
New Revision: 1032658

URL: http://svn.apache.org/viewvc?rev=1032658&view=rev
Log:
AMQ-3022 - Improve error message when a transaction is attempted to be suspended/resumed

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java?rev=1032658&r1=1032657&r2=1032658&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java Mon Nov  8 18:19:23 2010
@@ -334,12 +334,17 @@ public class TransactionContext implemen
             throw new XAException(XAException.XAER_PROTO);
         }
 
-        // if ((flags & TMJOIN) == TMJOIN) {
-        // // TODO: verify that the server has seen the xid
-        // }
-        // if ((flags & TMJOIN) == TMRESUME) {
-        // // TODO: verify that the xid was suspended.
-        // }
+        String txSuspendResumeNotSupportMsg = "The suspend/resume of a transaction " 
+        	+ "is not supported. Instead it is recommended that a new JMS session be created.";
+        
+        if ((flags & TMJOIN) == TMJOIN) {
+        	throw new XAException(txSuspendResumeNotSupportMsg);
+        // TODO: verify that the server has seen the xid
+        }
+        if ((flags & TMRESUME) == TMRESUME) {
+        	throw new XAException(txSuspendResumeNotSupportMsg);
+        // TODO: verify that the xid was suspended.
+        }
 
         // associate
         synchronizations = null;



Re: svn commit: r1032658 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java

Posted by Bruce Snyder <br...@gmail.com>.
On Fri, Nov 12, 2010 at 12:12 PM, Gary Tully <ga...@gmail.com> wrote:
> Hey Bruce, this change breaks a bunch of tests in the ra module. The
> RA does support XA and has some giggery pokery to manage the sessions.
> Think this should be reverted.
> Hudson has the failures; see the ra module:
> https://hudson.apache.org/hudson/job/ActiveMQ/504/#showFailuresLink

My mistake, Gary. I have manually reverted those changes.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Re: svn commit: r1032658 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java

Posted by Gary Tully <ga...@gmail.com>.
Hey Bruce, this change breaks a bunch of tests in the ra module. The
RA does support XA and has some giggery pokery to manage the sessions.
Think this should be reverted.
Hudson has the failures; see the ra module:
https://hudson.apache.org/hudson/job/ActiveMQ/504/#showFailuresLink

On 8 November 2010 18:19,  <bs...@apache.org> wrote:
> Author: bsnyder
> Date: Mon Nov  8 18:19:23 2010
> New Revision: 1032658
>
> URL: http://svn.apache.org/viewvc?rev=1032658&view=rev
> Log:
> AMQ-3022 - Improve error message when a transaction is attempted to be suspended/resumed
>
> Modified:
>    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java
>
> Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java
> URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java?rev=1032658&r1=1032657&r2=1032658&view=diff
> ==============================================================================
> --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java (original)
> +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java Mon Nov  8 18:19:23 2010
> @@ -334,12 +334,17 @@ public class TransactionContext implemen
>             throw new XAException(XAException.XAER_PROTO);
>         }
>
> -        // if ((flags & TMJOIN) == TMJOIN) {
> -        // // TODO: verify that the server has seen the xid
> -        // }
> -        // if ((flags & TMJOIN) == TMRESUME) {
> -        // // TODO: verify that the xid was suspended.
> -        // }
> +        String txSuspendResumeNotSupportMsg = "The suspend/resume of a transaction "
> +               + "is not supported. Instead it is recommended that a new JMS session be created.";
> +
> +        if ((flags & TMJOIN) == TMJOIN) {
> +               throw new XAException(txSuspendResumeNotSupportMsg);
> +        // TODO: verify that the server has seen the xid
> +        }
> +        if ((flags & TMRESUME) == TMRESUME) {
> +               throw new XAException(txSuspendResumeNotSupportMsg);
> +        // TODO: verify that the xid was suspended.
> +        }
>
>         // associate
>         synchronizations = null;
>
>
>



-- 
http://blog.garytully.com
http://fusesource.com