<div dir="ltr">Mnesia does not sync the log to disc during transactions at all, that is too slow.<div><br></div><div><div>If you really need to sync your data/writes to disc use mnesia:sync_log(), which gives</div><div>some more safety, though notice that the data may still only be in harddrive caches.</div><div><br></div><div>mnesia:dump_log() can be used, but that also goes through the log file and ditches out the writes to table files before returning, so that is really slow.</div></div><div><br></div><div>sync_transaction and sync_dirty syncs the writes between other nodes before returning to the user, </div><div>so when combining with a dirty_read on a remote node the data is available.</div><div>If you also use transaction protection on your 'read' it is not necessary to use sync functions.<br></div><div><br></div><div>Clearer?</div><div><br></div><div><br></div><div><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 8, 2016 at 6:24 AM ARUN P <<a href="mailto:arunp@utl.in">arunp@utl.in</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br class="gmail_msg">
<br class="gmail_msg">
      Can someone kindly describe me what is the difference between sync<br class="gmail_msg">
transaction and dump log in mnesia.?. Because in my application I am<br class="gmail_msg">
using mnesia database and I observed that soon after writing data into<br class="gmail_msg">
table, if the system restarts the data will not be persistent, And I am<br class="gmail_msg">
aware of the mnesia dump_log_time_threshold and dump_log_write_threshold<br class="gmail_msg">
and i don't want to change these thresholds for time being. To solve<br class="gmail_msg">
this problem I used mnesia:sync_transaction/1 but that also fails ( in<br class="gmail_msg">
the function description of mnesia:sync_transaction in Mnesia Reference<br class="gmail_msg">
Manual its been told that the data will be logged to disk ). But if I<br class="gmail_msg">
call mnesia:dump_log/0 function soon after the write operation and<br class="gmail_msg">
restart the system the data will be persistent.<br class="gmail_msg">
<br class="gmail_msg">
Thanks in advance,<br class="gmail_msg">
Arun<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
erlang-questions mailing list<br class="gmail_msg">
<a href="mailto:erlang-questions@erlang.org" class="gmail_msg" target="_blank">erlang-questions@erlang.org</a><br class="gmail_msg">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" class="gmail_msg" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="gmail_msg">
</blockquote></div></div>