[Re] Storing objects in a binary file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Re] Storing objects in a binary file

Nicolas Petton
Hi,

Now I'm trying to use an ImageSegment to store my object now.

(ImageSegment new copyFromRootsForExport: (Array with: myObject))
writeForExport: 'myObject.extSeg'.

I thought it would work, but I have the same error again:
'This Context was not included in the ImageSegment'.

Thanks for your help.

Nicolas
--
Nicolas Petton
http://nico.bioskop.fr
            ___
          ooooooo
         OOOOOOOOO
        |Smalltalk|
         OOOOOOOOO
          ooooooo
           \   /
            [|]
--------------------------------
Ma clé PGP est disponible ici :
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE788C34D



signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Re] Storing objects in a binary file

Lukas Renggli
> I thought it would work, but I have the same error again:
> 'This Context was not included in the ImageSegment'.

You have to make sure that **no other objects** outside the segment
point to object inside the segment (with the exception of symbols).

For example, if you want to serialize the model of a Seaside
application you have to clear all sessions, otherwise your model will
be referenced through session objects, components and their callback
blocks. Also make sure that you don't have globals, class or pool
variables that point to your model. All in all I find it quite tricky
to get it working.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch