Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 27 lines (17 sloc) 0.917 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
$ERL_TOP/bin/erl -boot start_sasl -kernel dist_auto_connect once -sname n1 -pa ~/ETC/git/unsplit/ebin -mnesia debug trace
$ERL_TOP/bin/erl -boot start_sasl -kernel dist_auto_connect once -sname n2 -pa ~/ETC/git/unsplit/ebin -mnesia debug trace

mnesia:start().
application:start(unsplit).
rd(test,{key,modified=erlang:now(),value}).

On n2@debian:

mnesia:create_schema([n1@debian,n2@debian]).

mnesia:delete_table(test).
mnesia:create_table(test,[{ram_copies,[n1@debian,n2@debian]},{attributes,[key,modified,value]},{user_properties,[{unsplit_method,{unsplit_lib,last_modified,[]}}]}]).

mnesia:transaction(fun() -> mnesia:write(#test{key=1,value=a}) end).
mnesia:transaction(fun() -> mnesia:write(#test{key=2,value=a}) end).

ets:tab2list(test).


On n1@debian:

disconnect_node(n2@debian).
mnesia:transaction(fun() -> mnesia:write(#test{key=2,value=b}) end).
timer:sleep(3000).
net_kernel:connect_node(n2@debian).
Something went wrong with that request. Please try again.