Persisting 'applications'

Bob.Cowdery at CGI-Europe.com Bob.Cowdery at CGI-Europe.com
Wed Feb 22 22:40:39 UTC 2006


Chris

It didn't click I was talking to the author. Thanks for taking the time,
much appreciated. I have managed to get myself a little confused. I'm not
long with Squeak so I am still in discovery mode. I found I had hundreds of
live objects in my image so thought it best to find out how to manage
lifetimes in the image before tackling Magma. I have a new image and
everything loaded back in. I think I understand how to delete morphs now,
but it does take some effort to make them 'really' go. 

However, when I make them persistent I get into some trouble. I just can't
seem to delete them from the database I've tried:

sdrBackplane := myMagmaSession root at: 'SDRBackplane'

to get a reference and then

myMagmaSession root: sdrBackplane
MagmaSession cleanup
myMagmaSession root removeKey: 'SDRBackplane'

to remove it (and variations thereof)

If I do:

SDRBackplane allInstances

I can get rid of any instances showing by:

sdrBackplane := nil
CommandHistory resetAllHistory
Smalltalk garbageCollect

Here's the interesting part. Once there are no instances in the image I can
get one from the db by: 

sdrBackplane := myMagmaSession root at: 'SDRBackplane'
sdrBackplane openInWorld

and lo and behold the connectors are still connected. It seems that if I get
an instance or even close one (via the halo) and openInWorld again the
connections are broken. It is the act of closing it and opening again that
breaks the connections - NOT MAGMA. This happens even when it's not
persistent.

So if you tell me how to delete objects reliably from Magma I think I might
be there.

I tried this with the SystemWindow. Making sure it was gone from the image.
What I get back is the SDRBackplane (which is just a PasteUpMorph) but it
has the white background and border of the window rather than its own.

Sorry it's a bit rambling. I haven't won the lottery yet but if I do you
will be the first to benefit !

Regards
Bob
--------------------------

Sorry for the delayed response Bob.

> My connectors come
> back connected unless I
> close the morph. Then the next load from the
> database they are disconnected.
> Still in place but the ends floating. Do you know of
> any way to close the
> morph without this happening? 

Its possible that the Connectors may need some
initialization on rematerialization.  Magma itself
does not require connectors so I have not extended any
of its classes with any pre or post serialization
stuff.

Did you store the Morphs while they were opened and
running in the world?  I try to support both, but you
might have better luck one way or the other.

Sorry I don't have a more definitive answer.  If you
want to get it working here is a suggested approach
(and I can guide you if you wish).

Explore your Radio in the committing image just before
you commit, getting ready to explore its full tree of
state.

In the retrieving image, after opening up the Radio in
the world, explore it.

Now place the two Squeak images side-by-side and work
down through each tree to find what objects in the
receiving image do not match the ones in the
committing image.

These objects will probably need a pre or post
serialization operation.  You can see some examples of
how I set up various pre/post-ops on some of Squeaks
built-in classes (like Color, PasteUpMorph and
Project) by looking at the method
MaObjectSerializer>>#setUpPreAndPostProcessing.

If you get this far let me know, I can probably help
you implement those methods.

> Also if I put in a
> window it restores without
> the window. I think I understand this because the
> window is not the root
> object. If I could get a reference to the window
> somehow and commit that I'm
> sure it would work.

That's a good guess but I'm not sure..  For Morphs
directly in the World, Magma does not serialize their
'owner' (the World).  However, I would think since you
put the RadioMorph into a window (a SystemWindow?)
that its 'owner' would be changed the window, not the
World, so it should have serialized its owner.

Sigh.  I'm sure I could debug this and figure it out
in person; do you have any money?  :)

Otherwise, just email me private if you wish and I'll
do my best to help you from afar.

Regards,
  Chris


*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060222/98db5b2d/attachment.htm


More information about the Squeak-dev mailing list