[Seaside] GOODS Updating a Collection inside of a Dictionary node.

ld s001 at landr.net
Tue May 18 16:39:56 CEST 2004


Ben Schroeder wrote:

>Hi Larry,
>
>  
>
>>I've got GOODS installed and am tinkering with it.  I have a usage
>>question.  I've created a root as a Dictionary. With values as Ordered
>>Collections.  Each Ordered Collection corresponds to a table  in an
>>RDBMS, that I'm converting to Squeak.
>>Each item in the Collection is an array representing a tuple or row from
>>the table. My question is: how would I update an array item in the
>>Ordered Collection. Is there a better way, than
>>1) retrieving the entire collection:   db root at: 'foo'
>>2) changing on of the items.  someCollection at: x put: y
>>3) writing the collection back to the dictionary.  db root at: 'foo'
>>put: someCollection
>>    
>>
>
>This is how I would do it, but step (3) shouldn't be necessary.  You can say
>
>    someCollection := db root at: 'foo'.
>    someCollection at: x put: y.
>    
>    db commit.
>
>and the commit should pick up the new contents of the collection.
>
>  
>
    This implies that the database connection should remain open during 
the session, correct?. and NOT closed after every read like I was 
doing.  -Larry

>Also, the GOODS client uses proxies that only load objects when needed, so
>step (1) should not be too expensive: it would probably load the
>collection's list of the objects that were in it, but not all of the objects
>themselves.
>
>Hope this helps,
>Ben Schroeder
>
>_______________________________________________
>Seaside mailing list
>Seaside at lists.squeakfoundation.org
>http://lists.squeakfoundation.org/listinfo/seaside
>
>
>  
>



More information about the Seaside mailing list