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] <
[email protected]> 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-found-td4703739.html
>
> 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&amp;node=4755097&amp;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-tp4755088p4755092.html
>>  To start a new topic under Pharo Smalltalk Users, email <a
>> href="x-msg://56/user/SendEmail.jtp?type=node&amp;node=4755097&amp;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=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
> ------------------------------
> View this message in context: Re: Voyage: how to delete references to
> objects.<http://forum.world.st/Voyage-how-to-delete-references-to-objects-tp4755088p4755097.html>
> 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-tp4755088p4755102.html
>  To start a new topic under Pharo Smalltalk Users, email
> [email protected]
> To unsubscribe from Pharo Smalltalk Users, click 
> here<http://forum.world.st/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1310670&code=c2FiaW5lLmtub2VmZWxAZ21haWwuY29tfDEzMTA2NzB8MTA0OTM5MTYx>
> .
> NAML<http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://forum.world.st/Voyage-how-to-delete-references-to-objects-tp4755088p4755106.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to