<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello, <br>
<br>
Please create frag table:<br>
<br>
rd(testCounter, {key, value}).<br>
testCounter<br>
<br>
mnesia:create_table(tTest<br>
, [{ram_copies, [node()]}<br>
,{type,set}<br>
,{attributes,record_info(fields,
testCounter)}<br>
,{record_name, testCounter}<br>
,{frag_properties, [{n_fragments, 10},
{n_ram_copies, 1}, {node_pool, [node()]}]}])<br>
<br>
and insert record using mnesia:write/3 func, that is called in
mnesia_frag access context:<br>
<br>
mnesia:activity(sync_dirty, fun()-> mnesia:table_info(tTest,
size) end, [], mnesia_frag).<br>
0<br>
mnesia:activity(sync_dirty, fun() -> mnesia:write(tTest,
{testCounter, 100, 200}, write) end, [], mnesia_frag).<br>
ok<br>
mnesia:activity(sync_dirty, fun()-> mnesia:table_info(tTest,
size) end, [], mnesia_frag).<br>
1<br>
[T || T <- ([tTest] ++ [list_to_atom("tTest_frag" ++
integer_to_list(N)) || N <- lists:seq(2, 10)]),
mnesia:table_info(T, size) > 0].<br>
[tTest_frag2]<br>
ets:tab2list(tTest_frag2).<br>
[#testCounter{key = 100,value = 200}]<br>
<br>
<b>We have 1 record in table in frag: tTest_frag2</b><br>
<br>
Now please "insert" record using mnesia:dirty_update_counter/3:<br>
<br>
[mnesia:clear_table(T) || T <- ([tTest] ++
[list_to_atom("tTest_frag" ++ integer_to_list(N)) || N <-
lists:seq(2, 10)])].<br>
[{atomic,ok},<br>
{atomic,ok},<br>
{atomic,ok},<br>
{atomic,ok},<br>
{atomic,ok},<br>
{atomic,ok},<br>
{atomic,ok},<br>
{atomic,ok},<br>
{atomic,ok},<br>
{atomic,ok}]<br>
mnesia:activity(sync_dirty, fun()-> mnesia:table_info(tTest,
size) end, [], mnesia_frag).<br>
0<br>
mnesia:activity(sync_dirty, fun() ->
mnesia:dirty_update_counter(tTest, 100, 200) end, [], mnesia_frag).<br>
200<br>
mnesia:activity(sync_dirty, fun()-> mnesia:table_info(tTest,
size) end, [], mnesia_frag).<br>
1<br>
[T || T <- ([tTest] ++ [list_to_atom("tTest_frag" ++
integer_to_list(N)) || N <- lists:seq(2, 10)]),
mnesia:table_info(T, size) > 0].<br>
[tTest]<br>
ets:tab2list(tTest).<br>
[#testCounter{key = 100,value = 200}]<br>
<br>
<b>Now record goes to 1st frag: tTest</b><br>
<br>
So it looks, that dirty_update_counter doesn't handle frag table
properly.<br>
<br>
Best regards<br>
Aleksander Nycz<br>
<br>
</body>
</html>