From cbdbdb6c3234c4436c914603abb537874ca13029 Mon Sep 17 00:00:00 2001 From: absc Date: Fri, 11 Oct 2024 20:25:58 +0000 Subject: [PATCH] Use the partitioning access functions for mnesia. --- storage/src/storage.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/src/storage.erl b/storage/src/storage.erl index 83be868..d14cc39 100644 --- a/storage/src/storage.erl +++ b/storage/src/storage.erl @@ -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.