anchor.diff:  		Res ->
   		    Res
   	    end;
  +	Err->
  +	    Err
  +    end.
  +
  +refresh_connect(ServerName, PoolId, Host, Port, User, Password, Database, Encoding, Reconnect,
  +       LinkConnection, OldState) ->
  +    Port1 = if Port == undefined -> ?PORT; true -> Port end,
  +    Fun = if LinkConnection ->
  +		  fun mysql_conn:start_link/8;
  +	     true ->
  +		  fun mysql_conn:start/8
  +	  end,
  +
  +%%    {ok, LogFun} = gen_server:call(ServerName, get_logfun),
  +	LogFun = OldState#state.log_fun,
  +    case Fun(Host, Port1, User, Password, Database, LogFun,
  +	     Encoding, PoolId) of
  +	{ok, ConnPid} ->
  +	    Conn = new_conn(ServerName, PoolId, ConnPid, Reconnect, Host, Port1, User,
  +			    Password, Database, Encoding),
  +		NewState = add_conn(Conn, OldState),
  +		{ok, ConnPid, NewState};
  +%% 	    case gen_server:call(
  +%% 		   ServerName, {add_conn, Conn}) of
  +%% 		ok ->
  +%% 		    {ok, ConnPid};
  +%% 		Res ->
  +%% 		    Res
  +%% 	    end;
   	Err->
   	    Err
       end.
  
positive.code:     crypto:start(),
      gen_server:StartFunc(
        {local, ServerName}, ?MODULE,
        [PoolId, Host, Port, User, Password, Database, LogFun, Encoding], []).
  
  
  %% @equiv connect(PoolId, Host, Port, User, Password, Database, Encoding,
  %%	   Reconnect, true)
  connect(ServerName, PoolId, Host, Port, User, Password, Database, Encoding, Reconnect) ->
      connect(ServerName, PoolId, Host, Port, User, Password, Database, Encoding,
  	    Reconnect, true).
  
negative.code:     ok.
  
  reconnect_loop(Conn, LogFun, N) ->
      {ServerName, PoolId, Host, Port} = {Conn#conn.server_name, Conn#conn.pool_id, Conn#conn.host, Conn#conn.port},
      case connect(ServerName,
  		 PoolId,
  		 Host,
  		 Port,
  		 Conn#conn.user,
  