14.03.2015, 18:54
Hi, i need a bit of help.
I'm using the callback OnQueryError and checking if its CR_SERVER_GONE_ERROR, to lock the server and avoid trouble. But the problem is that we lost connection with the database, but the server was kept on.
Errors: http://pastebin.com/fvBNWfQc
Script:
I'm using the callback OnQueryError and checking if its CR_SERVER_GONE_ERROR, to lock the server and avoid trouble. But the problem is that we lost connection with the database, but the server was kept on.
Errors: http://pastebin.com/fvBNWfQc
Script:
Code:
public OnQueryError(errorid, error[], callback[], qquery[], connectionHandle) { switch (errorid) { case CR_SERVER_GONE_ERROR: { printf(">>>>>>>>>>>>>>>>>>>> Lost connection to MYSQL, trying reconnect..."); mysql_reconnect(connectionHandle); if (mysql_errno() != 0) { //lock the server } else { //unlock it } } } return 1; }