<p>You may limit the number of retries when you are implementing <a href="http://arxiv.org/pdf/1001.3756.pdf" rel="nofollow">soft real-time systems</a> in which certain operations have to occur within a defined duration of time or at a specified time and if they don't, another action must be taken. <br><br>In such a case, you do not want other processes to wait while not being sure whether the transaction has been successful. However, several transaction contexts of mnesia may change the way transaction commits are done in your application. <br><br>
However, in my personal experience, real-time systems with mnesia ought to be handled using mnesia events, whereby, any write, update, delete, insert, e.t.c generates an instantaneous Event to all subscribed Processes/Servers, there and then. So those who receive this event message would take any action they desire possible.</p>
Mnesia: when would you limit the number of transaction retries?
<p>Mnesia lets you limit the number of times it retries a transaction:</p>

<pre><code>MyFun = fun() -&gt; ... end,
{atomic, ok} = mnesia:transaction(MyFun, [], 42)
</code></pre>

<p>If you don't specify a number, it defaults to <code>infinity</code>.</p>

<p>I've never seen any code that actually limits the number of retries. Have you? In what cases is it useful?</p>