Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
April 2014
- 76 participants
- 540 messages
Re: [Pharo-users] Voyage: how to delete references to objects.
by Norbert Hartl
Am 17.04.2014 um 15:52 schrieb Sabine Knöfel <sabine.knoefel(a)gmail.com>:
> Hi Norbert,
>
> for me the gain within smalltalk is huge because I want to navigate from person to trip and from trip to person by the attributes without asking mongo for the correspondent object via indexes.
>
> Don't you think that this is a question of design of the object model and should not be decided by database arguments?
>
I think there isnât only one _or_ the other. Of course it is a lot more beautiful to have set up proper objects and collections and do everything in a smalltalkish way. That does only count as long as you stay on the island (smalltalk image). As soon as you start to play with the outer world you have to change your rules. If you agree it isnât perfectly beautiful if you have a proper object model that freezes your image, right? :)
IMHO the beauty comes from a mixture of both that fit them together without restricting one or the other.
So I would try to avoid storing both directions. But which one to skip? If I assume that a person can have a lot of trips than I would skip the collection inside Person. The more trips a Person has the bigger the serialized document becomes. This makes it first slower to operate on the database and will fail if you reach a document size of 16MB because that is the maximum Mongo supports. Most of the time this will be a non-issue but for now I take it into account.
So the data model will have a class Trip with an instVar pointing to Person. And Person will have an instVar trips that is transient (see VOMongoTransientDescription). The implementation for Person then goes
Person>>#trips
^ trips ifNil: [ trips := self fetchTrips ]
Person>>#fetchTrips
^ Trips selectMany: [: each| ⦠]
Person>>#addTrip: aTrip
aTrip person: self.
aTrip save
So the Trip will have a reference to Person in the database but Person will have no reference to Trip. Person will retrieve its trips as soon as they are used in a really smalltalkish way :). Person acts as a smalltalk object and as a database object cache at the same time.
So this an implementation of Person that on the inside takes the database nature in regard but on the outside the interface is pure smalltalk.
Still not good?
Norbert
> Regards
> Sabine
>
>
> On Thu, Apr 17, 2014 at 3:40 PM, NorbertHartl [via Smalltalk] <[hidden email]> wrote:
> Sabine,
>
> I read the case now the first time. Just one note. Having references in both directions is probably not the best idea if using a non-object store. For navigating the graph it might be good but for persisting it is not. The serialization is a lot more complex if you do and the gain is nothing. For most databases with proper indexes you can request both directions easily and fast. So having one reference pointing from A to B you get the opposite direction for free.
>
> Norbert
>
> Am 17.04.2014 um 15:22 schrieb Sabine Knöfel <[hidden email]>:
>
>> Hi Olivier,
>>
>> possibly the option
>> VOMongoContainer>>enableMissingContent;
>> is useful to avoid
>> http://forum.world.st/Voyage-image-freeze-VOMongoError-Lazy-reference-not-f…
>>
>> Here is an example:
>> http://esug.org/data/ESUG2013/4-Thu/03-ESUG2013%20-%20VoyageTutorial.pdf
>>
>> Regards
>> Sabine
>>
>>
>>
>>
>> On Thu, Apr 17, 2014 at 3:07 PM, Olivier Auverlot [via Smalltalk] <<a href="x-msg://56/user/SendEmail.jtp?type=node&node=4755097&i=0" target="_top" rel="nofollow" link="external">[hidden email]> wrote:
>> thanks Robert for the explications.
>>
>> I agree with you that's the best way to remove a book is to delete the reference in ComicsCollection.
>>
>> But how to do that ? Must I simply remove the reference in the ordered collection ? Voyage will syncronize automatically the data in memory with the content of the database ? Must I force the save of the data after removing the reference ?
>>
>> Olivier ;-)
>>
>>
>> 2014-04-17 14:10 GMT+02:00 Norbert Hartl <[hidden email]>:
>>
>>
>> Am 17.04.2014 um 13:53 schrieb olivier <[hidden email]>:
>>
>> > Hi,
>> >
>> > I'm using Voyage in a Pharo application.
>> >
>> > I have two MongoDB collections which are ComicsCollection and ComicsBook. Each book is attached to a instance of ComicsCollection. The reference of each book is stored in an ordered collection (in the instance of ComicsCollection). The problem is that if I remove a book, the reference to the book is not deleted from ComicsCollection.
>> >
>> > How can I remove properly a book and the reference to the book ?
>> >
>> From the smalltalk image view the problem is usually exactly the opposite: You donât delete objects but you remove references to them. As voyage maps objects it is a good idea to stay in the object realm. So you should rather remove the book from the collection. This way you wonât get errors just garbage. The ârealâ problem that arises then is that the book would still be in the database. Just like it is in the image but there is no garbage collector for mongo. To decide that from the image is not possible. You load only a sub graph from the database into image memory. So you donât know if there are other objects referencing the book.
>>
>> If your records fit all in memory you could load all collections and books and build the difference between all referenced books in the collections and the total amount of books. The difference will be the set of objects not being referenced by a collection and those can be deleted.
>>
>> If the records do not fit in memory an alternative strategy would be needed. I started to research if it is possible to build a map/reduce based garbage collector for common cases but got distracted. But I have the same problem so I will need to pick it up some time.
>>
>> hope that helps,
>>
>> Norbert
>>
>>
>>
>>
>>
>> If you reply to this email, your message will be added to the discussion below:
>> http://forum.world.st/Voyage-how-to-delete-references-to-objects-tp4755088p…
>> To start a new topic under Pharo Smalltalk Users, email <a href="x-msg://56/user/SendEmail.jtp?type=node&node=4755097&i=1" target="_top" rel="nofollow" link="external">[hidden email]
>> To unsubscribe from Pharo Smalltalk Users, click here.
>> NAML
>>
>>
>> View this message in context: Re: Voyage: how to delete references to objects.
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://forum.world.st/Voyage-how-to-delete-references-to-objects-tp4755088p…
> To start a new topic under Pharo Smalltalk Users, email [hidden email]
> To unsubscribe from Pharo Smalltalk Users, click here.
> NAML
>
>
> View this message in context: Re: Voyage: how to delete references to objects.
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
April 17, 2014
Re: [Pharo-users] Voyage: how to delete references to objects.
by Sabine Knöfel
Hi Norbert,
for me the gain within smalltalk is huge because I want to navigate from
person to trip and from trip to person by the attributes without asking
mongo for the correspondent object via indexes.
Don't you think that this is a question of design of the object model and
should not be decided by database arguments?
Regards
Sabine
On Thu, Apr 17, 2014 at 3:40 PM, NorbertHartl [via Smalltalk] <
ml-node+s1294792n4755102h57(a)n4.nabble.com> wrote:
> Sabine,
>
> I read the case now the first time. Just one note. Having references in
> both directions is probably not the best idea if using a non-object store.
> For navigating the graph it might be good but for persisting it is not. The
> serialization is a lot more complex if you do and the gain is nothing. For
> most databases with proper indexes you can request both directions easily
> and fast. So having one reference pointing from A to B you get the opposite
> direction for free.
>
> Norbert
>
> Am 17.04.2014 um 15:22 schrieb Sabine Knöfel <[hidden email]<http://user/SendEmail.jtp?type=node&node=4755102&i=0>
> >:
>
> Hi Olivier,
>
> possibly the option
> VOMongoContainer>>enableMissingContent;
> is useful to avoid
>
> http://forum.world.st/Voyage-image-freeze-VOMongoError-Lazy-reference-not-f…
>
> Here is an example:
> http://esug.org/data/ESUG2013/4-Thu/03-ESUG2013%20-%20VoyageTutorial.pdf
>
> Regards
> Sabine
>
>
>
>
> On Thu, Apr 17, 2014 at 3:07 PM, Olivier Auverlot [via Smalltalk] <<a
> href="x-msg://56/user/SendEmail.jtp?type=node&node=4755097&i=0"
> target="_top" rel="nofollow" link="external">[hidden email]> wrote:
>
>> thanks Robert for the explications.
>>
>> I agree with you that's the best way to remove a book is to delete the
>> reference in ComicsCollection.
>>
>> But how to do that ? Must I simply remove the reference in the ordered
>> collection ? Voyage will syncronize automatically the data in memory with
>> the content of the database ? Must I force the save of the data after
>> removing the reference ?
>>
>> Olivier ;-)
>>
>>
>> 2014-04-17 14:10 GMT+02:00 Norbert Hartl <[hidden email]<http://user/SendEmail.jtp?type=node&node=4755092&i=0>
>> >:
>>
>>
>>> Am 17.04.2014 um 13:53 schrieb olivier <[hidden email]<http://user/SendEmail.jtp?type=node&node=4755092&i=1>
>>> >:
>>>
>>> > Hi,
>>> >
>>> > I'm using Voyage in a Pharo application.
>>> >
>>> > I have two MongoDB collections which are ComicsCollection and
>>> ComicsBook. Each book is attached to a instance of ComicsCollection. The
>>> reference of each book is stored in an ordered collection (in the instance
>>> of ComicsCollection). The problem is that if I remove a book, the reference
>>> to the book is not deleted from ComicsCollection.
>>> >
>>> > How can I remove properly a book and the reference to the book ?
>>> >
>>> From the smalltalk image view the problem is usually exactly the
>>> opposite: You donât delete objects but you remove references to them. As
>>> voyage maps objects it is a good idea to stay in the object realm. So you
>>> should rather remove the book from the collection. This way you wonât get
>>> errors just garbage. The ârealâ problem that arises then is that the book
>>> would still be in the database. Just like it is in the image but there is
>>> no garbage collector for mongo. To decide that from the image is not
>>> possible. You load only a sub graph from the database into image memory. So
>>> you donât know if there are other objects referencing the book.
>>>
>>> If your records fit all in memory you could load all collections and
>>> books and build the difference between all referenced books in the
>>> collections and the total amount of books. The difference will be the set
>>> of objects not being referenced by a collection and those can be deleted.
>>>
>>> If the records do not fit in memory an alternative strategy would be
>>> needed. I started to research if it is possible to build a map/reduce based
>>> garbage collector for common cases but got distracted. But I have the same
>>> problem so I will need to pick it up some time.
>>>
>>> hope that helps,
>>>
>>> Norbert
>>>
>>>
>>>
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://forum.world.st/Voyage-how-to-delete-references-to-objects-tp4755088p…
>> To start a new topic under Pharo Smalltalk Users, email <a
>> href="x-msg://56/user/SendEmail.jtp?type=node&node=4755097&i=1"
>> target="_top" rel="nofollow" link="external">[hidden email]
>> To unsubscribe from Pharo Smalltalk Users, click here.
>> NAML<http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instan…>
>>
>
>
> ------------------------------
> View this message in context: Re: Voyage: how to delete references to
> objects.<http://forum.world.st/Voyage-how-to-delete-references-to-objects-tp4755088p…>
> Sent from the Pharo Smalltalk Users mailing list archive<http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html>at
> Nabble.com.
>
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://forum.world.st/Voyage-how-to-delete-references-to-objects-tp4755088p…
> To start a new topic under Pharo Smalltalk Users, email
> ml-node+s1294792n1310670h65(a)n4.nabble.com
> To unsubscribe from Pharo Smalltalk Users, click here<http://forum.world.st/template/NamlServlet.jtp?macro=unsubscribe_by_code&no…>
> .
> NAML<http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instan…>
>
--
View this message in context: http://forum.world.st/Voyage-how-to-delete-references-to-objects-tp4755088p…
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
April 17, 2014
Re: [Pharo-users] Voyage: how to delete references to objects.
by Norbert Hartl
Sabine,
I read the case now the first time. Just one note. Having references in both directions is probably not the best idea if using a non-object store. For navigating the graph it might be good but for persisting it is not. The serialization is a lot more complex if you do and the gain is nothing. For most databases with proper indexes you can request both directions easily and fast. So having one reference pointing from A to B you get the opposite direction for free.
Norbert
Am 17.04.2014 um 15:22 schrieb Sabine Knöfel <sabine.knoefel(a)gmail.com>:
> Hi Olivier,
>
> possibly the option
> VOMongoContainer>>enableMissingContent;
> is useful to avoid
> http://forum.world.st/Voyage-image-freeze-VOMongoError-Lazy-reference-not-f…
>
> Here is an example:
> http://esug.org/data/ESUG2013/4-Thu/03-ESUG2013%20-%20VoyageTutorial.pdf
>
> Regards
> Sabine
>
>
>
>
> On Thu, Apr 17, 2014 at 3:07 PM, Olivier Auverlot [via Smalltalk] <[hidden email]> wrote:
> thanks Robert for the explications.
>
> I agree with you that's the best way to remove a book is to delete the reference in ComicsCollection.
>
> But how to do that ? Must I simply remove the reference in the ordered collection ? Voyage will syncronize automatically the data in memory with the content of the database ? Must I force the save of the data after removing the reference ?
>
> Olivier ;-)
>
>
> 2014-04-17 14:10 GMT+02:00 Norbert Hartl <[hidden email]>:
>
>
> Am 17.04.2014 um 13:53 schrieb olivier <[hidden email]>:
>
> > Hi,
> >
> > I'm using Voyage in a Pharo application.
> >
> > I have two MongoDB collections which are ComicsCollection and ComicsBook. Each book is attached to a instance of ComicsCollection. The reference of each book is stored in an ordered collection (in the instance of ComicsCollection). The problem is that if I remove a book, the reference to the book is not deleted from ComicsCollection.
> >
> > How can I remove properly a book and the reference to the book ?
> >
> From the smalltalk image view the problem is usually exactly the opposite: You donât delete objects but you remove references to them. As voyage maps objects it is a good idea to stay in the object realm. So you should rather remove the book from the collection. This way you wonât get errors just garbage. The ârealâ problem that arises then is that the book would still be in the database. Just like it is in the image but there is no garbage collector for mongo. To decide that from the image is not possible. You load only a sub graph from the database into image memory. So you donât know if there are other objects referencing the book.
>
> If your records fit all in memory you could load all collections and books and build the difference between all referenced books in the collections and the total amount of books. The difference will be the set of objects not being referenced by a collection and those can be deleted.
>
> If the records do not fit in memory an alternative strategy would be needed. I started to research if it is possible to build a map/reduce based garbage collector for common cases but got distracted. But I have the same problem so I will need to pick it up some time.
>
> hope that helps,
>
> Norbert
>
>
>
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://forum.world.st/Voyage-how-to-delete-references-to-objects-tp4755088p…
> To start a new topic under Pharo Smalltalk Users, email [hidden email]
> To unsubscribe from Pharo Smalltalk Users, click here.
> NAML
>
>
> View this message in context: Re: Voyage: how to delete references to objects.
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
April 17, 2014
Re: [Pharo-users] Voyage: how to delete references to objects.
by Sabine Knöfel
Hi Olivier,
possibly the option
VOMongoContainer>>enableMissingContent;
is useful to avoid
http://forum.world.st/Voyage-image-freeze-VOMongoError-Lazy-reference-not-f…
Here is an example:
http://esug.org/data/ESUG2013/4-Thu/03-ESUG2013%20-%20VoyageTutorial.pdf
Regards
Sabine
On Thu, Apr 17, 2014 at 3:07 PM, Olivier Auverlot [via Smalltalk] <
ml-node+s1294792n4755092h47(a)n4.nabble.com> wrote:
> thanks Robert for the explications.
>
> I agree with you that's the best way to remove a book is to delete the
> reference in ComicsCollection.
>
> But how to do that ? Must I simply remove the reference in the ordered
> collection ? Voyage will syncronize automatically the data in memory with
> the content of the database ? Must I force the save of the data after
> removing the reference ?
>
> Olivier ;-)
>
>
> 2014-04-17 14:10 GMT+02:00 Norbert Hartl <[hidden email]<http://user/SendEmail.jtp?type=node&node=4755092&i=0>
> >:
>
>
>> Am 17.04.2014 um 13:53 schrieb olivier <[hidden email]<http://user/SendEmail.jtp?type=node&node=4755092&i=1>
>> >:
>>
>> > Hi,
>> >
>> > I'm using Voyage in a Pharo application.
>> >
>> > I have two MongoDB collections which are ComicsCollection and
>> ComicsBook. Each book is attached to a instance of ComicsCollection. The
>> reference of each book is stored in an ordered collection (in the instance
>> of ComicsCollection). The problem is that if I remove a book, the reference
>> to the book is not deleted from ComicsCollection.
>> >
>> > How can I remove properly a book and the reference to the book ?
>> >
>> From the smalltalk image view the problem is usually exactly the
>> opposite: You donât delete objects but you remove references to them. As
>> voyage maps objects it is a good idea to stay in the object realm. So you
>> should rather remove the book from the collection. This way you wonât get
>> errors just garbage. The ârealâ problem that arises then is that the book
>> would still be in the database. Just like it is in the image but there is
>> no garbage collector for mongo. To decide that from the image is not
>> possible. You load only a sub graph from the database into image memory. So
>> you donât know if there are other objects referencing the book.
>>
>> If your records fit all in memory you could load all collections and
>> books and build the difference between all referenced books in the
>> collections and the total amount of books. The difference will be the set
>> of objects not being referenced by a collection and those can be deleted.
>>
>> If the records do not fit in memory an alternative strategy would be
>> needed. I started to research if it is possible to build a map/reduce based
>> garbage collector for common cases but got distracted. But I have the same
>> problem so I will need to pick it up some time.
>>
>> hope that helps,
>>
>> Norbert
>>
>>
>>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://forum.world.st/Voyage-how-to-delete-references-to-objects-tp4755088p…
> To start a new topic under Pharo Smalltalk Users, email
> ml-node+s1294792n1310670h65(a)n4.nabble.com
> To unsubscribe from Pharo Smalltalk Users, click here<http://forum.world.st/template/NamlServlet.jtp?macro=unsubscribe_by_code&no…>
> .
> NAML<http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instan…>
>
--
View this message in context: http://forum.world.st/Voyage-how-to-delete-references-to-objects-tp4755088p…
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
April 17, 2014
Re: [Pharo-users] Voyage: how to delete references to objects.
by olivier auverlot
Norbert,
Sorry for my mistake ;-)
2014-04-17 15:18 GMT+02:00 Norbert Hartl <norbert(a)hartl.name>:
>
> Am 17.04.2014 um 15:05 schrieb olivier auverlot <
> olivier.auverlot(a)gmail.com>:
>
> thanks Robert for the explications.
>
> Itâs Norbert btw. :)
>
> I agree with you that's the best way to remove a book is to delete the
> reference in ComicsCollection.
>
> But how to do that ? Must I simply remove the reference in the ordered
> collection ? Voyage will syncronize automatically the data in memory with
> the content of the database ? Must I force the save of the data after
> removing the reference ?
>
> You need to explicitly save it as we donât have something like write
> barriers in the image. So
>
> aComicCollection
> removeBook: aBook;
> save
>
> is needed.
>
> Norbert
>
> Olivier ;-)
>
>
> 2014-04-17 14:10 GMT+02:00 Norbert Hartl <norbert(a)hartl.name>:
>
>>
>> Am 17.04.2014 um 13:53 schrieb olivier <olivier.auverlot(a)gmail.com>:
>>
>> > Hi,
>> >
>> > I'm using Voyage in a Pharo application.
>> >
>> > I have two MongoDB collections which are ComicsCollection and
>> ComicsBook. Each book is attached to a instance of ComicsCollection. The
>> reference of each book is stored in an ordered collection (in the instance
>> of ComicsCollection). The problem is that if I remove a book, the reference
>> to the book is not deleted from ComicsCollection.
>> >
>> > How can I remove properly a book and the reference to the book ?
>> >
>> From the smalltalk image view the problem is usually exactly the
>> opposite: You donât delete objects but you remove references to them. As
>> voyage maps objects it is a good idea to stay in the object realm. So you
>> should rather remove the book from the collection. This way you wonât get
>> errors just garbage. The ârealâ problem that arises then is that the book
>> would still be in the database. Just like it is in the image but there is
>> no garbage collector for mongo. To decide that from the image is not
>> possible. You load only a sub graph from the database into image memory. So
>> you donât know if there are other objects referencing the book.
>>
>> If your records fit all in memory you could load all collections and
>> books and build the difference between all referenced books in the
>> collections and the total amount of books. The difference will be the set
>> of objects not being referenced by a collection and those can be deleted.
>>
>> If the records do not fit in memory an alternative strategy would be
>> needed. I started to research if it is possible to build a map/reduce based
>> garbage collector for common cases but got distracted. But I have the same
>> problem so I will need to pick it up some time.
>>
>> hope that helps,
>>
>> Norbert
>>
>>
>>
>
>
April 17, 2014
Re: [Pharo-users] Voyage: how to delete references to objects.
by Norbert Hartl
Am 17.04.2014 um 15:05 schrieb olivier auverlot <olivier.auverlot(a)gmail.com>:
> thanks Robert for the explications.
>
Itâs Norbert btw. :)
> I agree with you that's the best way to remove a book is to delete the reference in ComicsCollection.
>
> But how to do that ? Must I simply remove the reference in the ordered collection ? Voyage will syncronize automatically the data in memory with the content of the database ? Must I force the save of the data after removing the reference ?
>
You need to explicitly save it as we donât have something like write barriers in the image. So
aComicCollection
removeBook: aBook;
save
is needed.
Norbert
> Olivier ;-)
>
>
> 2014-04-17 14:10 GMT+02:00 Norbert Hartl <norbert(a)hartl.name>:
>
> Am 17.04.2014 um 13:53 schrieb olivier <olivier.auverlot(a)gmail.com>:
>
> > Hi,
> >
> > I'm using Voyage in a Pharo application.
> >
> > I have two MongoDB collections which are ComicsCollection and ComicsBook. Each book is attached to a instance of ComicsCollection. The reference of each book is stored in an ordered collection (in the instance of ComicsCollection). The problem is that if I remove a book, the reference to the book is not deleted from ComicsCollection.
> >
> > How can I remove properly a book and the reference to the book ?
> >
> From the smalltalk image view the problem is usually exactly the opposite: You donât delete objects but you remove references to them. As voyage maps objects it is a good idea to stay in the object realm. So you should rather remove the book from the collection. This way you wonât get errors just garbage. The ârealâ problem that arises then is that the book would still be in the database. Just like it is in the image but there is no garbage collector for mongo. To decide that from the image is not possible. You load only a sub graph from the database into image memory. So you donât know if there are other objects referencing the book.
>
> If your records fit all in memory you could load all collections and books and build the difference between all referenced books in the collections and the total amount of books. The difference will be the set of objects not being referenced by a collection and those can be deleted.
>
> If the records do not fit in memory an alternative strategy would be needed. I started to research if it is possible to build a map/reduce based garbage collector for common cases but got distracted. But I have the same problem so I will need to pick it up some time.
>
> hope that helps,
>
> Norbert
>
>
>
April 17, 2014
Re: [Pharo-users] Voyage: how to delete references to objects.
by olivier auverlot
thanks Robert for the explications.
I agree with you that's the best way to remove a book is to delete the
reference in ComicsCollection.
But how to do that ? Must I simply remove the reference in the ordered
collection ? Voyage will syncronize automatically the data in memory with
the content of the database ? Must I force the save of the data after
removing the reference ?
Olivier ;-)
2014-04-17 14:10 GMT+02:00 Norbert Hartl <norbert(a)hartl.name>:
>
> Am 17.04.2014 um 13:53 schrieb olivier <olivier.auverlot(a)gmail.com>:
>
> > Hi,
> >
> > I'm using Voyage in a Pharo application.
> >
> > I have two MongoDB collections which are ComicsCollection and
> ComicsBook. Each book is attached to a instance of ComicsCollection. The
> reference of each book is stored in an ordered collection (in the instance
> of ComicsCollection). The problem is that if I remove a book, the reference
> to the book is not deleted from ComicsCollection.
> >
> > How can I remove properly a book and the reference to the book ?
> >
> From the smalltalk image view the problem is usually exactly the opposite:
> You donât delete objects but you remove references to them. As voyage maps
> objects it is a good idea to stay in the object realm. So you should rather
> remove the book from the collection. This way you wonât get errors just
> garbage. The ârealâ problem that arises then is that the book would still
> be in the database. Just like it is in the image but there is no garbage
> collector for mongo. To decide that from the image is not possible. You
> load only a sub graph from the database into image memory. So you donât
> know if there are other objects referencing the book.
>
> If your records fit all in memory you could load all collections and books
> and build the difference between all referenced books in the collections
> and the total amount of books. The difference will be the set of objects
> not being referenced by a collection and those can be deleted.
>
> If the records do not fit in memory an alternative strategy would be
> needed. I started to research if it is possible to build a map/reduce based
> garbage collector for common cases but got distracted. But I have the same
> problem so I will need to pick it up some time.
>
> hope that helps,
>
> Norbert
>
>
>
April 17, 2014
Re: [Pharo-users] Voyage: how to delete references to objects.
by Norbert Hartl
Am 17.04.2014 um 13:53 schrieb olivier <olivier.auverlot(a)gmail.com>:
> Hi,
>
> I'm using Voyage in a Pharo application.
>
> I have two MongoDB collections which are ComicsCollection and ComicsBook. Each book is attached to a instance of ComicsCollection. The reference of each book is stored in an ordered collection (in the instance of ComicsCollection). The problem is that if I remove a book, the reference to the book is not deleted from ComicsCollection.
>
> How can I remove properly a book and the reference to the book ?
>
>From the smalltalk image view the problem is usually exactly the opposite: You donât delete objects but you remove references to them. As voyage maps objects it is a good idea to stay in the object realm. So you should rather remove the book from the collection. This way you wonât get errors just garbage. The ârealâ problem that arises then is that the book would still be in the database. Just like it is in the image but there is no garbage collector for mongo. To decide that from the image is not possible. You load only a sub graph from the database into image memory. So you donât know if there are other objects referencing the book.
If your records fit all in memory you could load all collections and books and build the difference between all referenced books in the collections and the total amount of books. The difference will be the set of objects not being referenced by a collection and those can be deleted.
If the records do not fit in memory an alternative strategy would be needed. I started to research if it is possible to build a map/reduce based garbage collector for common cases but got distracted. But I have the same problem so I will need to pick it up some time.
hope that helps,
Norbert
April 17, 2014
Voyage: how to delete references to objects.
by olivier
Hi,
I'm using Voyage in a Pharo application.
I have two MongoDB collections which are ComicsCollection and ComicsBook. Each book is attached to a instance of ComicsCollection. The reference of each book is stored in an ordered collection (in the instance of ComicsCollection). The problem is that if I remove a book, the reference to the book is not deleted from ComicsCollection.
How can I remove properly a book and the reference to the book ?
Best regards
Olivier ;-)
April 17, 2014
Re: [Pharo-users] We need *you* for the upcoming Pharo's website
by Esteban Lorenzano
for this specific request, is images *of pharo* (because is for the home page)⦠but we welcome also screenshots of cool things made with pharo, to prepare a showcase :)
Esteban
On 17 Apr 2014, at 02:45, Esteban A. Maringolo <emaringolo(a)gmail.com> wrote:
> Sorry but I don't fully understand the request.
>
> You want screenshots of Pharo or about the things we build with Pharo?
>
>
>
> Esteban A. Maringolo
>
>
> 2014-04-16 6:16 GMT-03:00 Esteban Lorenzano <estebanlm(a)gmail.com>:
>> please do not answer all at once! (subtle irony)
>> anyway, I have to add that screencast has to be Pharo3 based.
>>
>> cheers,
>> Esteban
>>
>> On 15 Apr 2014, at 13:03, Damien Cassou <damien.cassou(a)gmail.com> wrote:
>>
>>> Hi everyone,
>>>
>>> we are working on a new website for Pharo! We need your help. If you
>>> have some time, please create and send us one of the following items:
>>>
>>> - An up-to-date screenshot of Pharo 3.0 that shows some cool features.
>>> It should be 800px wide ;
>>> - A screencast ;
>>> - A paragraph (around 40 words) that presents a nice topic about Pharo
>>> and a corresponding screenshot.
>>>
>>> We will select 1 large screenshot, 3 screencasts and 4 topic paragraphs.
>>>
>>> This could be a very nice way for you to contribute to Pharo!
>>>
>>> Best,
>>>
>>> --
>>> Damien Cassou
>>> http://damiencassou.seasidehosting.st
>>>
>>> "Success is the ability to go from one failure to another without
>>> losing enthusiasm."
>>> Winston Churchill
>>>
>>
>>
>
April 17, 2014