explicit setting of auto-reconnect (5.1 servers require it)
authorAleš Křenek <ljocha@ics.muni.cz>
Fri, 24 Aug 2007 12:42:39 +0000 (12:42 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Fri, 24 Aug 2007 12:42:39 +0000 (12:42 +0000)
org.glite.lb.server/src/lbs_db.c

index 7baaee1..ba7f7a6 100644 (file)
@@ -32,6 +32,7 @@ static edg_wll_ErrorCode db_connect(edg_wll_Context ctx, const char *cs, MYSQL *
        char    *buf = NULL;
        char    *host,*user,*pw,*db; 
        char    *slash,*at,*colon;
+       my_bool reconnect = 1;
 
        if (!cs) cs = DEFAULTCS;
 
@@ -40,6 +41,9 @@ static edg_wll_ErrorCode db_connect(edg_wll_Context ctx, const char *cs, MYSQL *
 
        mysql_options(*mysql, MYSQL_READ_DEFAULT_FILE, "my");
 
+/* XXX: may result in weird behaviour in the middle of transaction */
+       mysql_options(*mysql, MYSQL_OPT_RECONNECT, &reconnect);
+
        host = user = pw = db = NULL;
 
        buf = strdup(cs);