anchor.diff:                  false ->
                       if
                           Owner =:= OldOwner -> %% Same owner update the connection.
  -                            check_save_conn(UserSess, DalSess, update, Conn);
  +                            check_save_conn(UserSess, DalSess, update, {OldCon, Conn});
                           true -> %% Different owner, create a copy.
                               add_connect_internal(UserSess, DalSess, Conn#ddConn{id = undefined})
                       end
  
positive.code:             ?Error("~p connection failed: ~p", [Op, Error]),
              Msg = list_to_binary(lists:flatten(io_lib:format("~p", [Error]))),
              {error, Msg};
          Conn ->
              Conn#ddConn{owner = get_name(DalSess, Conn#ddConn.owner)};
          InvalidReturn ->
              ?Error("Invalid return on ~p connection ~p: The result:~n~p", [Op, Conn, InvalidReturn]),
              {error, <<"Invalid return saving the connection">>}
      end.
  
  -spec compare_connections(#ddConn{}, #ddConn{}) -> boolean().
  
negative.code: add_connect_internal(UserSess, DalSess, #ddConn{id = undefined, owner = Owner} = Conn) ->
      case UserSess:run_cmd(select, [ddConn, [{#ddConn{name='$1', owner='$2', id='$3', _='_'}
                                           , [{'=:=','$1',Conn#ddConn.name},{'=:=','$2',Owner}]
                                           , ['$_']}]]) of
          {[#ddConn{id = Id} = OldCon | _], true} ->
              %% User is updating is own connection no need for privileges
              NewCon = Conn#ddConn{id=Id},
              case compare_connections(OldCon, NewCon) of
                  true -> %% Connection not changed
                      Conn#ddConn{owner = get_name(DalSess, Conn#ddConn.owner)};
                  false ->
                      ?Info("replacing connection ~p, owner ~p", [NewCon, Owner]),
                      check_save_conn(UserSess, DalSess, update, {OldCon, NewCon})
              end;
          _ ->
              case UserSess:run_cmd(have_permission, [[manage_system, ?MANAGE_CONNS, ?CREATE_CONNS]]) of
                  true ->
  