[erlang-questions] mnesia question

Vance Shipley vances@REDACTED
Sat Nov 22 15:29:33 CET 2008

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

   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.



More information about the erlang-questions mailing list