implemented amb690
authorDavid Anderson <dvander@alliedmods.net>
Fri Aug 03 11:50:20 2007 +0000 (2007-08-03)
changeset 1261b8062e3158f6
parent 1260 8345fc11a0f6
child 1262 843e9ed0ff29
implemented amb690
extensions/mysql/mysql/MyDriver.cpp
     1.1 --- a/extensions/mysql/mysql/MyDriver.cpp	Fri Aug 03 11:44:51 2007 +0000
     1.2 +++ b/extensions/mysql/mysql/MyDriver.cpp	Fri Aug 03 11:50:20 2007 +0000
     1.3 @@ -101,6 +101,12 @@
     1.4  		mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&(info->maxTimeout));
     1.5  	}
     1.6  
     1.7 +	/* Have MySQL automatically reconnect if it times out or loses connection.
     1.8 +	 * This will prevent "MySQL server has gone away" errors after a while.
     1.9 +	 */
    1.10 +	my_bool my_true = true;
    1.11 +	mysql_options(mysql, MYSQL_OPT_RECONNECT, (const char *)&my_true);
    1.12 +
    1.13  	if (!mysql_real_connect(mysql,
    1.14  		info->host,
    1.15  		info->user,