summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-04-04 17:07:12 +0100
committerSimon MacMullen <simon@rabbitmq.com>2011-04-04 17:07:12 +0100
commit95f132f8a4324906a108208c37b720c8e811206d (patch)
tree23bdefa1ba53a6d12271cb1932896dd72b5930d3
parent9f9c7c5eabf3d6915afb0b0b62fe25d04101d50e (diff)
downloadrabbitmq-server-95f132f8a4324906a108208c37b720c8e811206d.tar.gz
Invoke all the create and add_binding callbacks in the same tx.
-rw-r--r--src/rabbit_binding.erl4
-rw-r--r--src/rabbit_exchange.erl4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl
index 8c6732f9..557a8f29 100644
--- a/src/rabbit_binding.erl
+++ b/src/rabbit_binding.erl
@@ -108,6 +108,10 @@ recover(XNames, QNames) ->
end, dict:new(), rabbit_durable_route),
rabbit_misc:execute_pre_post_mnesia_tx(
fun (Tx) ->
+ [begin
+ {ok, X} = rabbit_exchange:lookup(XName),
+ rabbit_exchange:callback(X, create, [Tx, X])
+ end|| XName <- XNames],
dict:map(fun (XName, Bindings) ->
{ok, X} = rabbit_exchange:lookup(XName),
rabbit_exchange:callback(X, add_bindings,
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl
index b39fe32c..acbc6c90 100644
--- a/src/rabbit_exchange.erl
+++ b/src/rabbit_exchange.erl
@@ -91,10 +91,6 @@ recover() ->
[_] -> Acc
end
end, [], rabbit_durable_exchange),
- rabbit_misc:execute_pre_post_mnesia_tx(
- fun (Tx) ->
- [rabbit_exchange:callback(X, create, [Tx, X]) || X <- Xs]
- end),
[XName || #exchange{name = XName} <- Xs].
callback(#exchange{type = XType}, Fun, Args) ->