Serialization woes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wild Wind

    #1

    Serialization woes

    Hello,

    I've been battling over this problem for
    the better part of a day, so I'd appreciate it
    if someone could shed some light here.

    I have a file which is produced by the custom binary
    serialization of an object (i.e. by implementing the
    ISerializable interface). This object has a hashtable
    as one of its members, and this hashtable is
    properly populated before the object that
    contains it is serialized to disk (again using
    custom serialization).

    I can confirm that when the file is created, it
    has information on the contents of the hashtable.

    However, when the object is deserialized, the
    hashtable now has all the data zapped from it.

    I've checked and rechecked that I am using the
    right names to put data in the SerializationIn fo
    object in GetObjectData, and to extract the data
    in the special serialization constructor.

    I wish I could know what went on behind
    the scenes between the call to deserialize the
    object and the call to the special constructor.
    It's as if the SerializationIn fo object is not
    being properly populated from the data in the
    file.

    Any help would be greatly appreciated.

    --
    Akin

    aknak at aksoto dot idps dot co dot uk


  • One Handed Man \( OHM - Terry Burns \)

    #2
    Re: Serialization woes

    Have you looked and compared your code to the
    System.Runtime. Serialization.I Serializable overview in the help file ?

    --

    OHM ( Terry Burns )
    . . . One-Handed-Man . . .
    If U Need My Email ,Ask Me

    Time flies when you don't know what you're doing

    "Wild Wind" <nobody@blackho le.com> wrote in message
    news:2oijirFaus d8U1@uni-berlin.de...[color=blue]
    > Hello,
    >
    > I've been battling over this problem for
    > the better part of a day, so I'd appreciate it
    > if someone could shed some light here.
    >
    > I have a file which is produced by the custom binary
    > serialization of an object (i.e. by implementing the
    > ISerializable interface). This object has a hashtable
    > as one of its members, and this hashtable is
    > properly populated before the object that
    > contains it is serialized to disk (again using
    > custom serialization).
    >
    > I can confirm that when the file is created, it
    > has information on the contents of the hashtable.
    >
    > However, when the object is deserialized, the
    > hashtable now has all the data zapped from it.
    >
    > I've checked and rechecked that I am using the
    > right names to put data in the SerializationIn fo
    > object in GetObjectData, and to extract the data
    > in the special serialization constructor.
    >
    > I wish I could know what went on behind
    > the scenes between the call to deserialize the
    > object and the call to the special constructor.
    > It's as if the SerializationIn fo object is not
    > being properly populated from the data in the
    > file.
    >
    > Any help would be greatly appreciated.
    >
    > --
    > Akin
    >
    > aknak at aksoto dot idps dot co dot uk
    >
    >[/color]


    Comment

    • Wild Wind

      #3
      Re: Serialization woes


      "Wild Wind" <nobody@blackho le.com> wrote in message
      news:2oijirFaus d8U1@uni-berlin.de...[color=blue]
      > Hello,
      >
      > I've been battling over this problem for
      > the better part of a day, so I'd appreciate it
      > if someone could shed some light here.
      >
      > I have a file which is produced by the custom binary
      > serialization of an object (i.e. by implementing the
      > ISerializable interface). This object has a hashtable
      > as one of its members, and this hashtable is
      > properly populated before the object that
      > contains it is serialized to disk (again using
      > custom serialization).
      >
      > I can confirm that when the file is created, it
      > has information on the contents of the hashtable.
      >
      > However, when the object is deserialized, the
      > hashtable now has all the data zapped from it.
      >
      > I've checked and rechecked that I am using the
      > right names to put data in the SerializationIn fo
      > object in GetObjectData, and to extract the data
      > in the special serialization constructor.
      >
      > I wish I could know what went on behind
      > the scenes between the call to deserialize the
      > object and the call to the special constructor.
      > It's as if the SerializationIn fo object is not
      > being properly populated from the data in the
      > file.[/color]

      OK, it seems from googling around that the problem
      is caused by the hashtable not being populated with
      its elements *until* deserialization is complete -
      at the time I am still deserializing it in the
      special deserialization constructor, this hasn't
      happened so there are no items in it.

      It also turns out that the solution is for the class
      that contains the hashtable and is being serialized/
      deserialized to implement the IDeserializatio nCallback
      interface and access the hashtable in the OnDeserializati on
      method of that call.

      --
      Akin

      aknak at aksoto dot idps dot co dot uk


      Comment

      • Guest

        #4
        Re: Serialization woes

        Hi,
        I ran into the same problem. However in the OnDeserializati on
        the hashTable member is still empty. it is only populated after the stream is closed.
        Were you able to find a solution to this?

        Thanks,
        Koichiro
        [color=blue]
        > Hello,
        >
        > I've been battling over this problem for
        > the better part of a day, so I'd appreciate it
        > if someone could shed some light here.
        >
        > I have a file which is produced by the custom binary
        > serialization of an object (i.e. by implementing the
        > ISerializable interface). This object has a hashtable
        > as one of its members, and this hashtable is
        > properly populated before the object that
        > contains it is serialized to disk (again using
        > custom serialization).
        >
        > I can confirm that when the file is created, it
        > has information on the contents of the hashtable.
        >
        > However, when the object is deserialized, the
        > hashtable now has all the data zapped from it.
        >
        > I've checked and rechecked that I am using the
        > right names to put data in the SerializationIn fo
        > object in GetObjectData, and to extract the data
        > in the special serialization constructor.
        >
        > I wish I could know what went on behind
        > the scenes between the call to deserialize the
        > object and the call to the special constructor.
        > It's as if the SerializationIn fo object is not
        > being properly populated from the data in the
        > file.
        >
        > Any help would be greatly appreciated.
        >
        > --
        > Akin
        >
        > aknak at aksoto dot idps dot co dot uk
        >
        >[/color]

        User submitted from AEWNET (http://www.aewnet.com/)

        Comment

        Working...