(EJAB-764) - "If the relational database is started or restarted after ejabberd is started, ejabberd does not reopen the connexions pool."
I installed 2.0.3 with OTP R11B-0 and connected it to our Postgresql Db and all works fine, but when I restart postgresql without restarting ejabberd, ejabberd won't recognize that it's connection has been broken and fails all subsequent attempts by clients to login.
Here's what I changed in the cfg to connect to the Db.
{auth_method, odbc}{odbc_server, "DSN=mydsn;UID=myuser;PWD=mypassword;DATABASE=mydatabase"}
{mod_last_odbc, []},
{mod_offline_odbc, []},
{mod_roster_odbc, []},
{mod_vcard_odbc, []},
I also changed the followihg because I thought perhaps the reconnect doesn't happen until a keepalive is sent:
{odbc_keepalive_interval, 120}
Did I misconfigure something?
Did I misunderstand the issue? I notice that there is another issue (EJAB-246) that sounds related, "ODBC: Reconnect should be trigger by sql_query error code".
Thanks.
Works for me using mysql
I installed 2.0.3 with OTP R11B-0 and connected it to our Postgresql Db and all works fine,
Maybe R11B-0 is too old? You could try with R11B-5, or R12B-5, or anything newer if a package is available for your system.
If you are lazy to compile Erlang yourself and you want to know if the problem could be fixed by using a more recent Erlang version, you can try to install ejabberd using ejabberd 2.0.3 binary installer from ProcessOne. It includes Erlang R12B-5, ejabberd, mysql and pgsql drivers.
but when I restart postgresql without restarting ejabberd, ejabberd won't recognize that it's connection has been broken and fails all subsequent attempts by clients to login.
It reconnects correctly for me using mysql. I don't have a pgsql server to test.
{auth_method, odbc}{odbc_server, "DSN=mydsn;UID=myuser;PWD=mypassword;DATABASE=mydatabase"}
This syntax is wrong, and I'm sure ejabberd didn't start with such line in ejabberd.cfg
{odbc_keepalive_interval, 120}
I didn't need to change this option.
I installed ejabberd 2.0.3, Erlang/OTP R12B-5, mysql from ejabberd-modules SVN.
Configuration of ejabberd: the default, with this change:
I create an account and login. All correct up to here.
Now I stop the MySQL server:
Immediately, ejabberd starts complaining in ejabberd.log:
If I logout and login again the Jabber client, it fails.
Then I start MySQL:
A few seconds later, ejabberd reports in ejabberd.log a lot of stuff, like:
Now I login again correctly.
Could it be OTP R11B-0?
Thanks for your reply.
The ODBC connection syntax should be correct. You can see that same format in the .cfg under "ODBC compatible or MSSQL Server".
Unlike you, when I stop postgres, there are no error messages in the ejabberd.log
I'll compile R12B-5 and see if that makes a difference.
ODBC reconnection works.
It appears that the reconnection capability is built into the pgsql module and not the generic odbc module.
Once I included the pgsql modules and adjusted the config, it worked fine.
Thanks again for your comments.