[erlang-questions] MySQL with emysql Issue

Sanath Prasanna <>
Mon Sep 2 12:02:57 CEST 2013


Hi all,
I used emysql to working with mysql in my Erlang Application. Sometimes,
follwoing error come & need to restart application to working properly.

Else set_connection {{'EXIT',{failed_to_connect_to_database,emfile}},
=ERROR REPORT==== 2-Sep-2013::12:49:21 ===
File operation error: emfile. Target: ./lib.beam. Function: get_file.
Process: code_server.

=ERROR REPORT==== 2-Sep-2013::12:49:21 ===
File operation error: emfile. Target:
/opt/test_app/system/lib/kernel-2.14.1/ebin/lib.beam. Function: get_file.
Process: code_server.

=ERROR REPORT==== 2-Sep-2013::12:49:21 ===
File operation error: emfile. Target:
/opt/test_app/system/lib/stdlib-1.17.1/ebin/lib.beam. Function: get_file.
Process: code_server.

=ERROR REPORT==== 2-Sep-2013::12:49:21 ===
File operation error: emfile. Target:
/opt/test_app/system/lib/sasl-2.1.9.2/ebin/lib.beam. Function: get_file.
Process: code_server.

=ERROR REPORT==== 2-Sep-2013::12:49:21 ===
File operation error: emfile. Target:
/opt/test_app/system/lib/compiler-4.7.1/ebin/lib.beam. Function: get_file.
Process: code_server.
Pls help to solve this.
Br,
Sanath


code :

case catch emysql:add_pool(ConnPoolId, Config#db_conn_data.pool_size,
Config#db_conn_data.username, Config#db_conn_data.password,
Config#db_conn_data.host, Config#db_conn_data.port, DbName, utf8) of
ok ->
{ok, ConnPoolId};
{error, pool_already_exists} ->
already_exist;
{'EXIT',{failed_to_connect_to_database, emfile}} ->
io:fwrite("Else set_connection ~p~n",[{{failed_to_connect_to_database,
emfile}, DbName, ConnPoolId}]),
catch spawn(?MODULE, update_status,["failed_to_connect_to_database"]),
error;
Else ->
catch spawn(?MODULE, update_status,["database_error"]),
io:fwrite("Else set_connection ~p~n",[{Else, DbName, ConnPoolId}]),
error
end.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130902/5a7bcd79/attachment.html>


More information about the erlang-questions mailing list