[hornetq-commits] JBoss hornetq SVN: r10327 - in branches/Branch_2_2_EAP: src/main/org/hornetq/core/management/impl and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Mar 14 18:07:55 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-03-14 18:07:55 -0400 (Mon, 14 Mar 2011)
New Revision: 10327

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
   branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
Log:
fixing tests

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java	2011-03-14 22:06:16 UTC (rev 10326)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java	2011-03-14 22:07:55 UTC (rev 10327)
@@ -1235,17 +1235,11 @@
       {
          ClientSessionImpl.log.warn("failover occured during commit throwing XAException.XA_RETRY");
 
-         if (e.getCode() == HornetQException.UNBLOCKED)
-         {
-            // Unblocked on failover
-            xaRetry = true;
-            throw new XAException(XAException.XA_RETRY);
-         }
-
-         ClientSessionImpl.log.warn(e.getMessage(), e);
-
-         // This should never occur
-         throw new XAException(XAException.XAER_RMERR);
+         // Unblocked on failover
+         xaRetry = true;
+         // Any error on commit -> RETRY
+         // We can't rollback a Prepared TX for definition
+         throw new XAException(XAException.XA_RETRY);
       }
    }
 

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java	2011-03-14 22:06:16 UTC (rev 10326)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java	2011-03-14 22:07:55 UTC (rev 10327)
@@ -1521,6 +1521,11 @@
    {
       checkStarted();
 
+      if (pageSizeBytes >= maxSizeBytes)
+      {
+         throw new IllegalStateException("pageSize has to be lower than maxSizeBytes. Invalid argument (" + pageSizeBytes + " < " + maxSizeBytes + ")");
+      }
+
       AddressSettings addressSettings = new AddressSettings();
       addressSettings.setDeadLetterAddress(DLA == null ? null : new SimpleString(DLA));
       addressSettings.setExpiryAddress(expiryAddress == null ? null : new SimpleString(expiryAddress));

Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java	2011-03-14 22:06:16 UTC (rev 10326)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java	2011-03-14 22:07:55 UTC (rev 10327)
@@ -1016,8 +1016,6 @@
 
       session.end(xid, XAResource.TMSUCCESS);
 
-      session.prepare(xid);
-
       crash(session);
 
       try
@@ -1028,7 +1026,7 @@
       }
       catch (XAException e)
       {
-         Assert.assertEquals(XAException.XA_RBOTHER, e.errorCode);
+         Assert.assertEquals(XAException.XAER_NOTA, e.errorCode);
       }
 
       ClientConsumer consumer = session.createConsumer(FailoverTestBase.ADDRESS);
@@ -1336,7 +1334,7 @@
 
       session2.end(xid, XAResource.TMSUCCESS);
 
-      session2.prepare(xid);
+     // session2.prepare(xid);
 
       crash(session2);
 
@@ -1348,7 +1346,8 @@
       }
       catch (XAException e)
       {
-         Assert.assertEquals(XAException.XA_RBOTHER, e.errorCode);
+         // it should be rolled back
+         Assert.assertEquals(XAException.XAER_NOTA, e.errorCode);
       }
 
       session1.close();



More information about the hornetq-commits mailing list