Author: jbertram
Date: 2012-02-09 17:17:22 -0500 (Thu, 09 Feb 2012)
New Revision: 12103
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
Log:
[HORNETQ-847] createQueue not idempotent
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
---
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2012-02-09
22:16:31 UTC (rev 12102)
+++
branches/Branch_2_2_AS7/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2012-02-09
22:17:22 UTC (rev 12103)
@@ -1683,6 +1683,7 @@
Filter filter = FilterImpl.createFilter(filterString);
+ long txID = -1;
long queueID = storageManager.generateUniqueID();
PageSubscription pageSubscription;
@@ -1710,10 +1711,29 @@
if (durable)
{
- storageManager.addQueueBinding(binding);
+ txID = storageManager.generateUniqueID();
+ storageManager.addQueueBinding(txID, binding);
}
- postOffice.addBinding(binding);
+ try
+ {
+ postOffice.addBinding(binding);
+ if (txID != -1)
+ {
+ storageManager.commitBindings(txID);
+ }
+ }
+ catch (Exception e)
+ {
+ if (txID != -1)
+ {
+ storageManager.rollbackBindings(txID);
+ }
+ queue.close();
+ pageSubscription.close();
+ throw e;
+ }
+
managementService.registerAddress(address);
managementService.registerQueue(queue, address, storageManager);
Show replies by date