[Glass] Can one get rid of ObsoleteMetaclass instances?

Martin McClure martin.mcclure at gemtalksystems.com
Wed May 14 10:24:50 PDT 2014


On 05/14/2014 07:33 AM, Pieter Nagel wrote:
> I tried to achieve this by forcing the ObsoleteMetaclass instances to be
> dirty somehow so that they get written back to the repository in their
> "converted to Metaclass3" state.
>
> But this was a no-go, since they are invariant and _beInvariantWhile: is
> only defined on Class, not Metaclass3.
>
> Is there any way to force a GemStone object in general to be considered
> dirty and written back to disk at commit time?
>


You can force a metaclass to become dirty and be committed to a new
page. I haven't tried it with an ObsoleteMetaclass that has been
converted in memory, but it might well work.

As SystemUser, add a method to Metaclass3:

makeDirty
   name := name

Then you can send this message to any metaclass, and commit, and the
metaclass will be committed. For at least system classes you need to be
SystemUser to avoid ObjectSecurityPolicy violations, for
customer-defined classes this may not be necessary. I've tried this with
Object class, and it does move pages each time I do this.

Regards,

-Martin



More information about the Glass mailing list