Home Help Center

\ in Identity

DeepDiverDeepDiver Member Thomas MuellerOrganization: Freelance Software DeveloperProject: Project depend on Customers ✭✭✭
hi,

i have some issue with Ice.Identity and the utility functions.

Galcier2 is creating a random category for callbacks.
This category can contain \.
I use ice_toString() on a callback proxy to save it to a file for persistency.
In cases of restart the I get an ObjectNotExistException, because the object
identity's category is wrong.

Object Identity before restart: 2z7l\\FVtJvuQbiv+ZN\']/CommonObserver
Object Identity after restart: 2z7l\\\\FVtJvuQbiv+ZN\\\']/CommonObserver

I wrote a small app to show the Identity issue:
using System;
using System.Collections.Generic;
using System.Text;

namespace IceIdentity
{
    class Program
    {
        static void Main( string[] args )
        {
            Ice.Identity id = new Ice.Identity( "some name", @"some\category" );
            string idstr = Ice.Util.identityToString( id );

            Ice.Identity new_id = Ice.Util.stringToIdentity( idstr );

            Console.WriteLine( "Ice.Identify: {0} {1}", id.name, id.category );
            Console.WriteLine( "String of Ice.Identify: {0}", idstr );
            Console.WriteLine( "Ice.Identify: {0} {1}", new_id.name, new_id.category );
        }
    }
}

Any idea?

THX & CU
Tom

Comments

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    if you only want to generate random category ids you can use IceUtil::generateUUID() this works like a charm.

    I don't know if character '\' is valid for the id.name or id.category have you try to scape it '\\'
  • DeepDiverDeepDiver Member Thomas MuellerOrganization: Freelance Software DeveloperProject: Project depend on Customers ✭✭✭
    xdm wrote:
    if you only want to generate random category ids you can use IceUtil::generateUUID() this works like a charm.

    I don't know if character '\' is valid for the id.name or id.category have you try to scape it '\\'

    hi xdm,

    the category is generated by glacier2 - there is nothing i can do about this.
    according to the ice manual '\' is a valid char.

    i was debugging throught the code. looks like the method unescapeString
    is not doing as expected.

    cu tom
  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    Thanks for reporting this! I've posted a patch in the patch forum.

    Cheers,

    Michi.
Sign In or Register to comment.