[erlang-bugs] documentation bug(s) - mnesia:lock/2

Ulf Wiger ulf@REDACTED
Mon Oct 8 14:59:56 CEST 2007


In the documentation for mnesia:lock/2,

http://www.erlang.org/doc/man/mnesia.html#lock/2

one can read the following:

Currently, two kinds of LockItem's are supported by this function:

"{table, Tab}
    This acquires a lock of type LockKind on the entire table Tab.
{global, GlobalKey, Nodes}
    This acquires a lock of type LockKind on the global resource
GlobalKey. The lock is acquired on all active nodes in the Nodes list.
"

but the function also supports a third kind of LockItem (perhaps the most
interesting):

{record, Tab, Key}


Furthermore, it states that stick_write is not supported by the
function, but looking at the source, not only is sticky_write
(note the spelling) supported, but also 'none'.

Finally, looking at the function prototype:

lock(LockItem, LockKind) -> GoodNodes | transaction abort

This doesn't seem to be correct either. The function returns
the result of mnesia:read({Tab,Key}), or something to that
effect.

BR,
Ulf W

BR,
Ulf W



More information about the erlang-bugs mailing list