Re: [GemStone-Smalltalk] Does SystemRepository listInstances: ( Array with SomeClass) find absolutely all the instances of SomeClass in a Gemstone database?

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

Re: [GemStone-Smalltalk] Does SystemRepository listInstances: ( Array with SomeClass) find absolutely all the instances of SomeClass in a Gemstone database?

otto
> I am having trouble finding a rogue object that seems to be hanging out in my database.

How do you know it's there? If you get a stack trace, record the oop;
perhaps you can get the rogue's class oop as well. In topaz, use
"display oops" to get that if you need to.

> I'm pretty sure there is instance of a class hanging out in my database (it and its brethren periodically wake up and mess things around) but for the life of me I cannot find it.

Sometimes it is an instance of an older version of the class and you
can get the class with Foo classHistory. Sometimes the class is
disconnected. The surest way to find lost classes is to use Metaclass
allInstances. Select from this list: "select: [:meta | meta thisClass
name == #Foo]" to really find all classes with the name Foo. Then pass
this collection in to listInstances: which will return you a list of
arrays of instances.

> In a Smalltalk world I used to do 'SomeClass allIInstances'.  Is this what "SystemRepository listInstances" does, or do I have to loop over segments as well?

You don't have to loop over segments. Just pass all the classes you
want to find instances for in and you'll find instances.

HTH
Otto