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] < ml-node+s1294792n4755092...@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-tp4755088p4755092.html > To start a new topic under Pharo Smalltalk Users, email > ml-node+s1294792n1310670...@n4.nabble.com > 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-tp4755088p4755097.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.