Author: clebert.suconic(a)jboss.com
Date: 2010-09-08 18:11:16 -0400 (Wed, 08 Sep 2010)
New Revision: 9658
Modified:
branches/Branch_2_1/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
branches/Branch_2_1/src/main/org/hornetq/core/transaction/Transaction.java
branches/Branch_2_1/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java
branches/Branch_2_1/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java
Log:
HORNETQ-502 fixing a test
Modified:
branches/Branch_2_1/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
===================================================================
---
branches/Branch_2_1/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2010-09-08
19:40:33 UTC (rev 9657)
+++
branches/Branch_2_1/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2010-09-08
22:11:16 UTC (rev 9658)
@@ -612,6 +612,7 @@
else
{
Transaction tx = context.getTransaction();
+
boolean depage = tx.getProperty(TransactionPropertyIndexes.IS_DEPAGE) != null;
// if the TX paged at least one message on a give address, all the other
addresses should also go towards paging cache now
@@ -1243,7 +1244,15 @@
{
subTX = tx.copy();
}
+
route(message, subTX, false);
+
+ if (subTX.isContainsPersistent())
+ {
+ // The route wouldn't be able to update the persistent flag on
the main TX
+ // If we don't do this we would eventually miss a commit record
+ tx.setContainsPersistent();
+ }
}
}
Modified: branches/Branch_2_1/src/main/org/hornetq/core/transaction/Transaction.java
===================================================================
--- branches/Branch_2_1/src/main/org/hornetq/core/transaction/Transaction.java 2010-09-08
19:40:33 UTC (rev 9657)
+++ branches/Branch_2_1/src/main/org/hornetq/core/transaction/Transaction.java 2010-09-08
22:11:16 UTC (rev 9658)
@@ -72,6 +72,8 @@
Object getProperty(int index);
void setContainsPersistent();
+
+ boolean isContainsPersistent();
void setTimeout(int timeout);
Modified:
branches/Branch_2_1/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java
===================================================================
---
branches/Branch_2_1/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java 2010-09-08
19:40:33 UTC (rev 9657)
+++
branches/Branch_2_1/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java 2010-09-08
22:11:16 UTC (rev 9658)
@@ -131,6 +131,11 @@
{
containsPersistent = true;
}
+
+ public boolean isContainsPersistent()
+ {
+ return containsPersistent;
+ }
public void setTimeout(final int timeout)
{
Modified:
branches/Branch_2_1/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java
===================================================================
---
branches/Branch_2_1/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java 2010-09-08
19:40:33 UTC (rev 9657)
+++
branches/Branch_2_1/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java 2010-09-08
22:11:16 UTC (rev 9658)
@@ -339,6 +339,15 @@
}
+ /* (non-Javadoc)
+ * @see org.hornetq.core.transaction.Transaction#isContainsPersistent()
+ */
+ public boolean isContainsPersistent()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}
class FakeMessage implements ServerMessage
Show replies by date