Created
September 26, 2011 15:47
-
-
Save hiyosi/1242551 to your computer and use it in GitHub Desktop.
Mnesiaレコード更新
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add(add_http_list, Id, System, Uri, Port) -> | |
gen_server:call(?MODULE, {add_http_list, Id, System, Uri, Port}); | |
handle_call({add_http_list, Id, System, Uri, Port}, _From, State) -> | |
{reply, add_record_http_list(Id, System, Uri, Port), State}; | |
%% http_listテーブルにレコードを追加/更新する | |
add_record_http_list(Id, System, Uri, Port) -> | |
Row = #http_list{id=Id, system=System, uri=Uri, port=Port}, | |
F = fun() -> | |
mnesia:write(Row) | |
end, | |
mnesia:transaction(F). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment