[erlang-questions] rpc call and mnesia transaction

Sat Dec 15 17:36:46 CET 2012


I'm having some trouble with an rpc call in R5B03-1.

I have one node, mnesianode@REDACTED, with mnesia running and with a table

If I use rpc to read a record from a shell running on another node, it
works fine.

(another@REDACTED)1> Fun = fun() -> mnesia:read(mytable, akey) end.
(another@REDACTED)2> rpc:call('mnesianode@REDACTED', mnesia, transaction, [Fun]).

However, if I put the code in a file:


do() ->
    F = fun() -> mnesia:read(mytable, akey) end,
    {atomic, Result} = rpc:call('mnesianode@REDACTED', mnesia, transaction,

and try to execute anrpctest:do(), it fails.

(another@REDACTED)4> c(anrpctest).
(another@REDACTED)5> anrpctest:do().
** exception error: no match of right hand side value
     in function  anrpctest:do/0 (anrpctest.erl, ....

Any idea why this is happening?

Thanks and regards

More information about the erlang-questions mailing list