[erlang-questions] Mnesia nested transactions

Ulf Wiger (TN/EAB) ulf.wiger@REDACTED
Mon Feb 4 17:00:18 CET 2008

Vance Shipley skrev:
> Am I correct in thinking that using nested transactions
> could help minimize the impact of deadlock?
> If a transaction performs a number of operations on tables
> and then executes a nested transaction and that transaction
> encounters deadlock is the nested transaction restarted
> inside the outer transaction?  Or is the outer transaction
> restarted too?

 From mnesia_tm.erl (comment before restart/9):

%% We can only restart toplevel transactions.
%% If a deadlock situation occurs in a nested transaction
%% The whole thing including all nested transactions need to be
%% restarted. The stack is thus popped by a consequtive series of
%% exit({aborted, #cyclic{}}) calls

Ulf W

More information about the erlang-questions mailing list