Am 22.10.2011 um 10:42 schrieb Mariano Martinez Peck <marianopeck@gmail.com>:



On Sat, Oct 22, 2011 at 10:09 AM, Lukas Renggli <renggli@gmail.com> wrote:
I do not see how BTreePageOuter is used? Is that your own class? What
does that have to do with BTree?

Generally it is a bad idea to subclass collections. I am not sure, but
it could be that GOODS optimizes OrderedCollection access (look for
class extension from GOODS in OrderedCollection and superclasses).

Some other random remarks:

- I am not aware that anybody has used GOODS in the past year on Pharo
or even on a  Cog VM. So there might be (subtle) bugs. Do the tests
pass?

- GOODS loads things lazily. So it might be that when you look at
things through reflection (like the inspector), they do not load
properly. Also you need to make sure not to not access your objects
with optimized messages like #== or #yourself, because these do not
trigger the loading of the object.


And even worst... ifNil:  etc..
http://joachimtuchel.wordpress.com/2011/03/25/glorp-va-smalltalk-proxies-and-isnil/

Exactly. Back then working with Glorp I learned it the hard way. And then I learned that Glorp provides a yourSelf message that can help. It is like yourself but yourSelf will make sure a proxy is resolved.

Norbert
 
Lukas

On 22 October 2011 09:43, Jonathan Kelly <jonkelly@fastmail.fm> wrote:
> Hi,
>
> I thought I'd ask here first ... I got my BTree code working, so I thought
> I'd try to use it with the Goods DB, but it seems it's only storing and
> recovering the instance variables. My page class is
>
> OrderedCollection variableSubclass: #BTreePageOuter
>    instanceVariableNames: 'order count'
>    classVariableNames: ''
>    poolDictionaries: ''
>    category: 'BTree'
>
> db := KKDatabase onHost: 'localhost' port: 6543.
> db root: (BTree withOrder: 2).
> db root add: 'O1'.
> db commit.
> db logout.
>
> When I reconnect, instance variables order and count are set, but array
> (from the parent OrderedCollection) is nil.
>
> Jonathan.
> PS... squeaksource was down, so I downloaded the packages from the spanish
> mirror into my local package cache, and loaded them from there. I'm running
> 1.3 on COG (that came from the 1.2.1 single click).
> Package versions are:
> GOODS-cds.137.mcz
> GOODSCollections-cds.1.mcz
> GOODSPlatformSqueak-cds.6.mcz
>
>



--
Lukas Renggli
www.lukas-renggli.ch




--
Mariano
http://marianopeck.wordpress.com