thanks for the suggestion.<div>I changed all s_write, wread, s_delete to straightforward write, read, delete. it does not help.<br><br><div class="gmail_quote">On Sat, Nov 22, 2008 at 2:29 PM, Vance Shipley <span dir="ltr"><<a href="mailto:vances@motivity.ca">vances@motivity.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">On Sat, Nov 22, 2008 at 12:28:03AM +0000, Linan Wang wrote:<br>
</div><div class="Ih2E3d">} I found one strange thing that the last inserted row would lost<br>
} if not referenced after restart.<br>
<br>
</div>The problem is with the use of a sticky write lock:<br>
<div class="Ih2E3d">} mnesia:transaction(fun()-><br>
} mnesia:s_write(#oid{name = task, id = 0})<br>
} end),<br>
<br>
</div>If you change this to not use a sticky write lock it works as you<br>
expect:<br>
<br>
mnesia:transaction(fun()-> mnesia:write(#oid{name = task, id = 0}) end),<br>
<br>
I can't help but offer the advice given in Erlang Programming<br>
Rules section 3.8: Don't optimize code.<br>
<br>
<a href="http://www.erlang.se/doc/programming_rules.shtml#HDR6" target="_blank">http://www.erlang.se/doc/programming_rules.shtml#HDR6</a><br>
<font color="#888888"><br>
-Vance<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Best regards<br><br>Linan Wang<br>
</div>