Use the partitioning access functions for mnesia.
parent
3c40cc381e
commit
cbdbdb6c32
|
@ -709,7 +709,7 @@ handle_call({read, Bucket, Key}, _From, State) ->
|
|||
mnesia:read(Bucket, Key)
|
||||
end,
|
||||
|
||||
case mnesia:transaction(F) of
|
||||
case mnesia:activity(transaction, F, [], mnesia_frag) of
|
||||
{atomic, R} -> {reply, {ok, R}, State};
|
||||
{aborted, Reason} -> {reply, {error, Reason}, State}
|
||||
end;
|
||||
|
@ -723,7 +723,7 @@ handle_call({delete, Bucket, Key}, _From, State) ->
|
|||
mnesia:delete({Bucket, Key})
|
||||
end,
|
||||
|
||||
case mnesia:transaction(F) of
|
||||
case mnesia:activity(transaction, F, [], mnesia_frag) of
|
||||
{atomic, ok} -> {reply, ok, State};
|
||||
{aborted, Reason} -> {reply, {error, Reason}, State}
|
||||
end;
|
||||
|
@ -737,7 +737,7 @@ handle_call({delete_set, Bucket, Metadata}, _From, State) ->
|
|||
delete_matching(Bucket, Recs)
|
||||
end,
|
||||
|
||||
case mnesia:transaction(F) of
|
||||
case mnesia:activity(transaction, F, [], mnesia_frag) of
|
||||
{atomic, ok} -> {reply, ok, State};
|
||||
{aborted, Reason} -> {reply, {error, Reason}, State}
|
||||
end;
|
||||
|
@ -751,7 +751,7 @@ handle_call({write, Bucket, Key, Term, Metadata}, _From, State) ->
|
|||
mnesia:write(Bucket, R, write)
|
||||
end,
|
||||
|
||||
case mnesia:transaction(F) of
|
||||
case mnesia:activity(transaction, F, [], mnesia_frag) of
|
||||
{atomic, _} -> {reply, ok, State};
|
||||
{aborted, Reason} -> {reply, {error, Reason}, State}
|
||||
end.
|
||||
|
@ -806,7 +806,7 @@ search(Bucket, Metadata) ->
|
|||
qlc:e(Q)
|
||||
end,
|
||||
|
||||
case mnesia:transaction(F) of
|
||||
case mnesia:activity(transaction, F, [], mnesia_frag) of
|
||||
{atomic, L} -> {ok, L};
|
||||
{aborted, Reason} -> {error, Reason}
|
||||
end.
|
||||
|
|
Loading…
Reference in New Issue