[erlang-questions] mnesia question

Linan Wang <>
Sat Nov 22 17:32:52 CET 2008


thanks for the suggestion.I changed all s_write, wread, s_delete to
straightforward write, read, delete. it does not help.

On Sat, Nov 22, 2008 at 2:29 PM, Vance Shipley <> wrote:

> On Sat, Nov 22, 2008 at 12:28:03AM +0000, Linan Wang wrote:
> }  I found one strange thing that the last inserted row would lost
> }  if not referenced after restart.
>
> The problem is with the use of a sticky write lock:
> }              mnesia:transaction(fun()->
> }                      mnesia:s_write(#oid{name = task, id = 0})
> }                  end),
>
> If you change this to not use a sticky write lock it works as you
> expect:
>
>   mnesia:transaction(fun()-> mnesia:write(#oid{name = task, id = 0}) end),
>
> I can't help but offer the advice given in Erlang Programming
> Rules section 3.8:  Don't optimize code.
>
>        http://www.erlang.se/doc/programming_rules.shtml#HDR6
>
>        -Vance
>



-- 
Best regards

Linan Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081122/aab0a4c1/attachment.html>


More information about the erlang-questions mailing list