Voyage, Magritte descriptions, and nil exceptions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Voyage, Magritte descriptions, and nil exceptions

Tommaso DS
Hi,

I am having troubles with Voyage and Mongo.
I have some Classes that I save in Mongo, say "One", "Two", and "Three".
All three classes and are voyage roots, so the objects from each class
are stored in different collections.
One objects has a reference to Two or Three objects.

The problem arises when I use a Magritte description and define a Mongo
container to optimize the storage: since each class is stored in its own
collection, there is no point in storing the #instanceOf attribute as well.

Two>>mongoContainer
     <mongoContainer>

     ^ VOMongoContainer new
         kind: Two;
         yourself

If I add this method, when I try to load an object One, I get the
exception: "KeyNotFound: key #nil not found in SystemDictionary".
It looks like Voyage is not able to understand the type of the objects
stored in the collection Two, when loaded from a reference.

Am I missing something? Do I need to specify something more to make it work?

I reproduced the scenario in an image that can be downloaded here:
https://dl.dropboxusercontent.com/u/11506662/VoyageMongo-Link-Test.zip

Do you have any idea? Should I report this on the issue tracker?

Thanks!
Tommaso

Reply | Threaded
Open this post in threaded view
|

Re: Voyage, Magritte descriptions, and nil exceptions

Sabine Manaa
Hi Tommaso,

you did not define a One>>mongoContainer. I defined it and then it seems to work.

Regards

2016-03-06 1:42 GMT+01:00 Tommaso DS [via Smalltalk] <[hidden email]>:
Hi,

I am having troubles with Voyage and Mongo.
I have some Classes that I save in Mongo, say "One", "Two", and "Three".
All three classes and are voyage roots, so the objects from each class
are stored in different collections.
One objects has a reference to Two or Three objects.

The problem arises when I use a Magritte description and define a Mongo
container to optimize the storage: since each class is stored in its own
collection, there is no point in storing the #instanceOf attribute as well.

Two>>mongoContainer
     <mongoContainer>

     ^ VOMongoContainer new
         kind: Two;
         yourself

If I add this method, when I try to load an object One, I get the
exception: "KeyNotFound: key #nil not found in SystemDictionary".
It looks like Voyage is not able to understand the type of the objects
stored in the collection Two, when loaded from a reference.

Am I missing something? Do I need to specify something more to make it work?

I reproduced the scenario in an image that can be downloaded here:
https://dl.dropboxusercontent.com/u/11506662/VoyageMongo-Link-Test.zip

Do you have any idea? Should I report this on the issue tracker?

Thanks!
Tommaso




If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Voyage-Magritte-descriptions-and-nil-exceptions-tp4882726.html
To start a new topic under Pharo Smalltalk Users, email [hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Voyage, Magritte descriptions, and nil exceptions

Tommaso DS
Hi,

thanks for your answer, I also tried with One>>mongoContainer, but sadly that does not solve the issue.
I think it works in your case because you have the One object cached from the previous query, but if you inspect the "link" field, it should be nil.

If you reset the repository connection, it should give the exception again.

I'll keep trying :-)
Tommaso



On 07/03/16 14:07, Sabine Manaa wrote:
Hi Tommaso,

you did not define a One>>mongoContainer. I defined it and then it seems to work.

Regards

2016-03-06 1:42 GMT+01:00 Tommaso DS [via Smalltalk] <[hidden email]>:
Hi,

I am having troubles with Voyage and Mongo.
I have some Classes that I save in Mongo, say "One", "Two", and "Three".
All three classes and are voyage roots, so the objects from each class
are stored in different collections.
One objects has a reference to Two or Three objects.

The problem arises when I use a Magritte description and define a Mongo
container to optimize the storage: since each class is stored in its own
collection, there is no point in storing the #instanceOf attribute as well.

Two>>mongoContainer
     <mongoContainer>

     ^ VOMongoContainer new
         kind: Two;
         yourself

If I add this method, when I try to load an object One, I get the
exception: "KeyNotFound: key #nil not found in SystemDictionary".
It looks like Voyage is not able to understand the type of the objects
stored in the collection Two, when loaded from a reference.

Am I missing something? Do I need to specify something more to make it work?

I reproduced the scenario in an image that can be downloaded here:
https://dl.dropboxusercontent.com/u/11506662/VoyageMongo-Link-Test.zip

Do you have any idea? Should I report this on the issue tracker?

Thanks!
Tommaso




If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Voyage-Magritte-descriptions-and-nil-exceptions-tp4882726.html
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, Magritte descriptions, and nil exceptions
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Voyage, Magritte descriptions, and nil exceptions

EstebanLM
Hi Tommaso, 

that might be a bug… which version are you using?
if latest, can you fill a bug here: https://github.com/estebanlm/voyage/issues (so I do not forget it)?

thanks,
Esteban

On 08 Mar 2016, at 16:25, Tommaso Dal Sasso <[hidden email]> wrote:

Hi,

thanks for your answer, I also tried with One>>mongoContainer, but sadly that does not solve the issue.
I think it works in your case because you have the One object cached from the previous query, but if you inspect the "link" field, it should be nil.

If you reset the repository connection, it should give the exception again.

I'll keep trying :-)
Tommaso



On 07/03/16 14:07, Sabine Manaa wrote:
Hi Tommaso,

you did not define a One>>mongoContainer. I defined it and then it seems to work.

Regards

2016-03-06 1:42 GMT+01:00 Tommaso DS [via Smalltalk] <<a moz-do-not-send="true" href="x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]>:
Hi,

I am having troubles with Voyage and Mongo.
I have some Classes that I save in Mongo, say "One", "Two", and "Three".
All three classes and are voyage roots, so the objects from each class
are stored in different collections.
One objects has a reference to Two or Three objects.

The problem arises when I use a Magritte description and define a Mongo
container to optimize the storage: since each class is stored in its own
collection, there is no point in storing the #instanceOf attribute as well.

Two>>mongoContainer
     <mongoContainer>

     ^ VOMongoContainer new
         kind: Two;
         yourself

If I add this method, when I try to load an object One, I get the
exception: "KeyNotFound: key #nil not found in SystemDictionary".
It looks like Voyage is not able to understand the type of the objects
stored in the collection Two, when loaded from a reference.

Am I missing something? Do I need to specify something more to make it work?

I reproduced the scenario in an image that can be downloaded here:
https://dl.dropboxusercontent.com/u/11506662/VoyageMongo-Link-Test.zip

Do you have any idea? Should I report this on the issue tracker?

Thanks!
Tommaso




If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Voyage-Magritte-descriptions-and-nil-exceptions-tp4882726.html
To start a new topic under Pharo Smalltalk Users, email <a moz-do-not-send="true" href="x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML



View this message in context: Re: Voyage, Magritte descriptions, and nil exceptions
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Voyage, Magritte descriptions, and nil exceptions

Sabine Manaa
I don't think it is a bug, there is missing the description of the relationship between one and two:
If I define the following method, it works.

Thomasso, do you know this documentation?

https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/ws/book-result/Voyage/Voyage.pdf


One class>>mongoLink
 <mongoDescription>
^ VOMongoToOneDescription new
attributeName: 'link';
kind: Two;
yourself

regards
Sabine

2016-03-08 16:31 GMT+01:00 EstebanLM [via Smalltalk] <[hidden email]>:
Hi Tommaso, 

that might be a bug… which version are you using?
if latest, can you fill a bug here: https://github.com/estebanlm/voyage/issues (so I do not forget it)?

thanks,
Esteban

On 08 Mar 2016, at 16:25, Tommaso Dal Sasso <[hidden email]> wrote:

Hi,

thanks for your answer, I also tried with One>>mongoContainer, but sadly that does not solve the issue.
I think it works in your case because you have the One object cached from the previous query, but if you inspect the "link" field, it should be nil.

If you reset the repository connection, it should give the exception again.

I'll keep trying :-)
Tommaso



On 07/03/16 14:07, Sabine Manaa wrote:
Hi Tommaso,

you did not define a One>>mongoContainer. I defined it and then it seems to work.

Regards

2016-03-06 1:42 GMT+01:00 Tommaso DS [via Smalltalk] <<a moz-do-not-send="true" href="x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]>:
Hi,

I am having troubles with Voyage and Mongo.
I have some Classes that I save in Mongo, say "One", "Two", and "Three".
All three classes and are voyage roots, so the objects from each class
are stored in different collections.
One objects has a reference to Two or Three objects.

The problem arises when I use a Magritte description and define a Mongo
container to optimize the storage: since each class is stored in its own
collection, there is no point in storing the #instanceOf attribute as well.

Two>>mongoContainer
     <mongoContainer>

     ^ VOMongoContainer new
         kind: Two;
         yourself

If I add this method, when I try to load an object One, I get the
exception: "KeyNotFound: key #nil not found in SystemDictionary".
It looks like Voyage is not able to understand the type of the objects
stored in the collection Two, when loaded from a reference.

Am I missing something? Do I need to specify something more to make it work?

I reproduced the scenario in an image that can be downloaded here:
https://dl.dropboxusercontent.com/u/11506662/VoyageMongo-Link-Test.zip

Do you have any idea? Should I report this on the issue tracker?

Thanks!
Tommaso




If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Voyage-Magritte-descriptions-and-nil-exceptions-tp4882726.html
To start a new topic under Pharo Smalltalk Users, email <a moz-do-not-send="true" href="x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML



View this message in context: Re: Voyage, Magritte descriptions, and nil exceptions
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-Magritte-descriptions-and-nil-exceptions-tp4882726p4883253.html
To start a new topic under Pharo Smalltalk Users, email [hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Voyage, Magritte descriptions, and nil exceptions

Tommaso DS


On 08/03/16 19:58, Sabine Manaa wrote:
I don't think it is a bug, there is missing the description of the relationship between one and two:
If I define the following method, it works.

Thomasso, do you know this documentation?

https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/ws/book-result/Voyage/Voyage.pdf


One class>>mongoLink
 <mongoDescription>
^ VOMongoToOneDescription new
attributeName: 'link';
kind: Two;
yourself
 
Hi, thanks for your answer.

Indeed in this way it works, because the relation between One and Two is explicit. However, in this case I am not able anymore to link objects of the class Three, therefore loosing the dynamic capabilities of both MongoDB and Smalltalk.

I'll try to investigate a bit more, to understand if it is indeed a bug or what I am trying to do is simply not reasonable :-)

Tommaso


regards
Sabine

2016-03-08 16:31 GMT+01:00 EstebanLM [via Smalltalk] <[hidden email]>:
Hi Tommaso, 

that might be a bug… which version are you using?
if latest, can you fill a bug here: https://github.com/estebanlm/voyage/issues (so I do not forget it)?

thanks,
Esteban

On 08 Mar 2016, at 16:25, Tommaso Dal Sasso <[hidden email]> wrote:

Hi,

thanks for your answer, I also tried with One>>mongoContainer, but sadly that does not solve the issue.
I think it works in your case because you have the One object cached from the previous query, but if you inspect the "link" field, it should be nil.

If you reset the repository connection, it should give the exception again.

I'll keep trying :-)
Tommaso



On 07/03/16 14:07, Sabine Manaa wrote:
Hi Tommaso,

you did not define a One>>mongoContainer. I defined it and then it seems to work.

Regards

2016-03-06 1:42 GMT+01:00 Tommaso DS [via Smalltalk] <<a moz-do-not-send="true" href="x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]>:
Hi,

I am having troubles with Voyage and Mongo.
I have some Classes that I save in Mongo, say "One", "Two", and "Three".
All three classes and are voyage roots, so the objects from each class
are stored in different collections.
One objects has a reference to Two or Three objects.

The problem arises when I use a Magritte description and define a Mongo
container to optimize the storage: since each class is stored in its own
collection, there is no point in storing the #instanceOf attribute as well.

Two>>mongoContainer
     <mongoContainer>

     ^ VOMongoContainer new
         kind: Two;
         yourself

If I add this method, when I try to load an object One, I get the
exception: "KeyNotFound: key #nil not found in SystemDictionary".
It looks like Voyage is not able to understand the type of the objects
stored in the collection Two, when loaded from a reference.

Am I missing something? Do I need to specify something more to make it work?

I reproduced the scenario in an image that can be downloaded here:
https://dl.dropboxusercontent.com/u/11506662/VoyageMongo-Link-Test.zip

Do you have any idea? Should I report this on the issue tracker?

Thanks!
Tommaso




If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Voyage-Magritte-descriptions-and-nil-exceptions-tp4882726.html
To start a new topic under Pharo Smalltalk Users, email <a moz-do-not-send="true" href="x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML



View this message in context: Re: Voyage, Magritte descriptions, and nil exceptions
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-Magritte-descriptions-and-nil-exceptions-tp4882726p4883253.html
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, Magritte descriptions, and nil exceptions
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Voyage, Magritte descriptions, and nil exceptions

Sabine Manaa
In reply to this post by Sabine Manaa
you are right.

I tried to introduce a parent class "Numbers" as superclass of One, Two and Three and defined the relation like this

mongoLink
 <mongoDescription>
^ VOMongoToOneDescription new
attributeName: 'link';
kind: Numbers;
yourself

But it did not work.

I get a system error...I don't have so much time but I keep thinking and I am interested in your results.

My model is so, that I always have the same types in one relationship, so it did not occur in my project.

2016-03-08 19:58 GMT+01:00 Sabine Manaa <[hidden email]>:
I don't think it is a bug, there is missing the description of the relationship between one and two:
If I define the following method, it works.

Thomasso, do you know this documentation?

https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/ws/book-result/Voyage/Voyage.pdf


One class>>mongoLink
 <mongoDescription>
^ VOMongoToOneDescription new
attributeName: 'link';
kind: Two;
yourself

regards
Sabine

2016-03-08 16:31 GMT+01:00 EstebanLM [via Smalltalk] <[hidden email]>:
Hi Tommaso, 

that might be a bug… which version are you using?
if latest, can you fill a bug here: https://github.com/estebanlm/voyage/issues (so I do not forget it)?

thanks,
Esteban

On 08 Mar 2016, at 16:25, Tommaso Dal Sasso <[hidden email]> wrote:

Hi,

thanks for your answer, I also tried with One>>mongoContainer, but sadly that does not solve the issue.
I think it works in your case because you have the One object cached from the previous query, but if you inspect the "link" field, it should be nil.

If you reset the repository connection, it should give the exception again.

I'll keep trying :-)
Tommaso



On 07/03/16 14:07, Sabine Manaa wrote:
Hi Tommaso,

you did not define a One>>mongoContainer. I defined it and then it seems to work.

Regards

2016-03-06 1:42 GMT+01:00 Tommaso DS [via Smalltalk] <<a moz-do-not-send="true" href="x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]>:
Hi,

I am having troubles with Voyage and Mongo.
I have some Classes that I save in Mongo, say "One", "Two", and "Three".
All three classes and are voyage roots, so the objects from each class
are stored in different collections.
One objects has a reference to Two or Three objects.

The problem arises when I use a Magritte description and define a Mongo
container to optimize the storage: since each class is stored in its own
collection, there is no point in storing the #instanceOf attribute as well.

Two>>mongoContainer
     <mongoContainer>

     ^ VOMongoContainer new
         kind: Two;
         yourself

If I add this method, when I try to load an object One, I get the
exception: "KeyNotFound: key #nil not found in SystemDictionary".
It looks like Voyage is not able to understand the type of the objects
stored in the collection Two, when loaded from a reference.

Am I missing something? Do I need to specify something more to make it work?

I reproduced the scenario in an image that can be downloaded here:
https://dl.dropboxusercontent.com/u/11506662/VoyageMongo-Link-Test.zip

Do you have any idea? Should I report this on the issue tracker?

Thanks!
Tommaso




If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Voyage-Magritte-descriptions-and-nil-exceptions-tp4882726.html
To start a new topic under Pharo Smalltalk Users, email <a moz-do-not-send="true" href="x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML



View this message in context: Re: Voyage, Magritte descriptions, and nil exceptions
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-Magritte-descriptions-and-nil-exceptions-tp4882726p4883253.html
To start a new topic under Pharo Smalltalk Users, email [hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML


Reply | Threaded
Open this post in threaded view
|

Re: Voyage, Magritte descriptions, and nil exceptions

Sabine Manaa
It would be interesting to hear the opinion of esteban.

I geht the error:

***System error handling failed ***
Original error: VOMongoError: Lazy reference not found Numbers: OID(...)

2016-03-09 9:35 GMT+01:00 Sabine Manaa <[hidden email]>:
you are right.

I tried to introduce a parent class "Numbers" as superclass of One, Two and Three and defined the relation like this

mongoLink
 <mongoDescription>
^ VOMongoToOneDescription new
attributeName: 'link';
kind: Numbers;
yourself

But it did not work.

I get a system error...I don't have so much time but I keep thinking and I am interested in your results.

My model is so, that I always have the same types in one relationship, so it did not occur in my project.

2016-03-08 19:58 GMT+01:00 Sabine Manaa <[hidden email]>:
I don't think it is a bug, there is missing the description of the relationship between one and two:
If I define the following method, it works.

Thomasso, do you know this documentation?

https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/ws/book-result/Voyage/Voyage.pdf


One class>>mongoLink
 <mongoDescription>
^ VOMongoToOneDescription new
attributeName: 'link';
kind: Two;
yourself

regards
Sabine

2016-03-08 16:31 GMT+01:00 EstebanLM [via Smalltalk] <[hidden email]>:
Hi Tommaso, 

that might be a bug… which version are you using?
if latest, can you fill a bug here: https://github.com/estebanlm/voyage/issues (so I do not forget it)?

thanks,
Esteban

On 08 Mar 2016, at 16:25, Tommaso Dal Sasso <[hidden email]> wrote:

Hi,

thanks for your answer, I also tried with One>>mongoContainer, but sadly that does not solve the issue.
I think it works in your case because you have the One object cached from the previous query, but if you inspect the "link" field, it should be nil.

If you reset the repository connection, it should give the exception again.

I'll keep trying :-)
Tommaso



On 07/03/16 14:07, Sabine Manaa wrote:
Hi Tommaso,

you did not define a One>>mongoContainer. I defined it and then it seems to work.

Regards

2016-03-06 1:42 GMT+01:00 Tommaso DS [via Smalltalk] <<a moz-do-not-send="true" href="x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]>:
Hi,

I am having troubles with Voyage and Mongo.
I have some Classes that I save in Mongo, say "One", "Two", and "Three".
All three classes and are voyage roots, so the objects from each class
are stored in different collections.
One objects has a reference to Two or Three objects.

The problem arises when I use a Magritte description and define a Mongo
container to optimize the storage: since each class is stored in its own
collection, there is no point in storing the #instanceOf attribute as well.

Two>>mongoContainer
     <mongoContainer>

     ^ VOMongoContainer new
         kind: Two;
         yourself

If I add this method, when I try to load an object One, I get the
exception: "KeyNotFound: key #nil not found in SystemDictionary".
It looks like Voyage is not able to understand the type of the objects
stored in the collection Two, when loaded from a reference.

Am I missing something? Do I need to specify something more to make it work?

I reproduced the scenario in an image that can be downloaded here:
https://dl.dropboxusercontent.com/u/11506662/VoyageMongo-Link-Test.zip

Do you have any idea? Should I report this on the issue tracker?

Thanks!
Tommaso




If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Voyage-Magritte-descriptions-and-nil-exceptions-tp4882726.html
To start a new topic under Pharo Smalltalk Users, email <a moz-do-not-send="true" href="x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML



View this message in context: Re: Voyage, Magritte descriptions, and nil exceptions
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-Magritte-descriptions-and-nil-exceptions-tp4882726p4883253.html
To start a new topic under Pharo Smalltalk Users, email [hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML



Reply | Threaded
Open this post in threaded view
|

Re: Voyage, Magritte descriptions, and nil exceptions

NorbertHartl
In reply to this post by Sabine Manaa

Am 09.03.2016 um 09:35 schrieb Sabine Manaa <[hidden email]>:

you are right.

I tried to introduce a parent class "Numbers" as superclass of One, Two and Three and defined the relation like this

mongoLink
 <mongoDescription>
^ VOMongoToOneDescription new
attributeName: 'link';
kind: Numbers;
yourself

But it did not work.

I get a system error...I don't have so much time but I keep thinking and I am interested in your results.

I think you can always expect problems when using magritte relationships that aren't homogenous. Voyage is capable of finding objects that are not of the same class. But they need to be in the same inheritance chain. Meaning if you request Numbers than all objects being found need to be kindOf Numbers. The second aspect is that the collection in mongo is derived from the class name so it cannot work because queries over multiple collections are not possible in mongo. You need to do

<mongoContainer>
^ VOMongoContainer new
collectionName: 'Numbers';
yourself

in all subclasses of Numbers. This way every object is stored in the same collection, a query will find them all and will istantiate them because they have the right relationship.

Norbert

My model is so, that I always have the same types in one relationship, so it did not occur in my project.

2016-03-08 19:58 GMT+01:00 Sabine Manaa <[hidden email]>:
I don't think it is a bug, there is missing the description of the relationship between one and two:
If I define the following method, it works.

Thomasso, do you know this documentation?

https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/ws/book-result/Voyage/Voyage.pdf


One class>>mongoLink
 <mongoDescription>
^ VOMongoToOneDescription new
attributeName: 'link';
kind: Two;
yourself

regards
Sabine

2016-03-08 16:31 GMT+01:00 EstebanLM [via Smalltalk] <[hidden email]>:
Hi Tommaso, 

that might be a bug… which version are you using?
if latest, can you fill a bug here: https://github.com/estebanlm/voyage/issues (so I do not forget it)?

thanks,
Esteban

On 08 Mar 2016, at 16:25, Tommaso Dal Sasso <[hidden email]> wrote:

Hi,

thanks for your answer, I also tried with One>>mongoContainer, but sadly that does not solve the issue.
I think it works in your case because you have the One object cached from the previous query, but if you inspect the "link" field, it should be nil.

If you reset the repository connection, it should give the exception again.

I'll keep trying :-)
Tommaso



On 07/03/16 14:07, Sabine Manaa wrote:
Hi Tommaso,

you did not define a One>>mongoContainer. I defined it and then it seems to work.

Regards

2016-03-06 1:42 GMT+01:00 Tommaso DS [via Smalltalk] <<a moz-do-not-send="true" href="<a href="x-msg://133/user/SendEmail.jtp?type=node&amp;amp;node=4882948&amp;amp;i=0" class="">x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]>:
Hi,

I am having troubles with Voyage and Mongo.
I have some Classes that I save in Mongo, say "One", "Two", and "Three".
All three classes and are voyage roots, so the objects from each class
are stored in different collections.
One objects has a reference to Two or Three objects.

The problem arises when I use a Magritte description and define a Mongo
container to optimize the storage: since each class is stored in its own
collection, there is no point in storing the #instanceOf attribute as well.

Two>>mongoContainer
     <mongoContainer>

     ^ VOMongoContainer new
         kind: Two;
         yourself

If I add this method, when I try to load an object One, I get the
exception: "KeyNotFound: key #nil not found in SystemDictionary".
It looks like Voyage is not able to understand the type of the objects
stored in the collection Two, when loaded from a reference.

Am I missing something? Do I need to specify something more to make it work?

I reproduced the scenario in an image that can be downloaded here:
https://dl.dropboxusercontent.com/u/11506662/VoyageMongo-Link-Test.zip

Do you have any idea? Should I report this on the issue tracker?

Thanks!
Tommaso




If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Voyage-Magritte-descriptions-and-nil-exceptions-tp4882726.html
To start a new topic under Pharo Smalltalk Users, email <a moz-do-not-send="true" href="<a href="x-msg://133/user/SendEmail.jtp?type=node&amp;amp;node=4882948&amp;amp;i=1" class="">x-msg://133/user/SendEmail.jtp?type=node&amp;node=4882948&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML



View this message in context: Re: Voyage, Magritte descriptions, and nil exceptions
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-Magritte-descriptions-and-nil-exceptions-tp4882726p4883253.html
To start a new topic under Pharo Smalltalk Users, email [hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML



Reply | Threaded
Open this post in threaded view
|

Re: Voyage, Magritte descriptions, and nil exceptions

Sabine Manaa
Norbert, thank you. Ok, the Numbers collection name is clear.

If I use

<mongoContainer>
^ VOMongoContainer new
collectionName: 'Numbers';
yourself

the data is stored correctly in the Numbers collection in Mongo. Also the relationship is fine.
Everything fine till here.

But after 

VOMongoRepository current reset.

I have problems with fetching the data from mongo

If I define

mongoContainer
<mongoContainer>
^ VOMongoContainer new
enableMissingContent;
collectionName: 'Numbers';
"kind: self;"
yourself

Then I get the error "Bad object requested (Three does not inherits from One)"

If I define 

mongoContainer
<mongoContainer>
^ VOMongoContainer new
enableMissingContent;
collectionName: 'Numbers';
kind: self;
yourself

Then I get an Inspector with 3 instances of "One" (I refer to the workspace of the image from tommasso)
It should be only one instance of One
Clicking on the one instances, I get an emergency screen with
 ***System error handling failed****
VOMongoError: Lazy reference not found ...
 
Tommasso, do you get the same results?

I am curious about the solution.


***************This is the workspace of tommasso
repository dropDatabase.
repository := VOMongoRepository
host: 'localhost'
database: 'VoyageMongo-Link-Test-5'.
repository enableSingleton.

one := One new.
two := Two new.
three := Three new.

one link: two.
one link: three.

one save.
two save.
three save.

VOMongoRepository current reset.

One   selectAll  
Reply | Threaded
Open this post in threaded view
|

Re: Voyage, Magritte descriptions, and nil exceptions

NorbertHartl
Sabine,

maybe my description wasn't clear enough. If you start to use voyage like that you have the constraint that all objects returned from the collection need to be the same or a subclass of the one you are using to search. Meaning

If you query

One selectAll

then all of the objects in the Numbers collection need to be the same class or a subclass of One. So this use case is at first only feasible if you want to find all instances of Numbers. Your basic query needs to be

Numbers selectAll

If you then want to deal only with instances of One you would need to add this to the query

Numbers selectMany: {
'#instanceOf' -> #One } asDictionary

This is not a nice approach but for this use case it should give you the desire result.

Norbert

Am 09.03.2016 um 10:52 schrieb Sabine Manaa <[hidden email]>:

Norbert, thank you. Ok, the Numbers collection name is clear.

If I use

<mongoContainer>
^ VOMongoContainer new
collectionName: 'Numbers';
yourself

the data is stored correctly in the Numbers collection in Mongo. Also the relationship is fine.
Everything fine till here.

But after 

VOMongoRepository current reset.

I have problems with fetching the data from mongo

If I define

mongoContainer
<mongoContainer>
^ VOMongoContainer new
enableMissingContent;
collectionName: 'Numbers';
"kind: self;"
yourself

Then I get the error "Bad object requested (Three does not inherits from One)"

If I define 

mongoContainer
<mongoContainer>
^ VOMongoContainer new
enableMissingContent;
collectionName: 'Numbers';
kind: self;
yourself

Then I get an Inspector with 3 instances of "One" (I refer to the workspace of the image from tommasso)
It should be only one instance of One
Clicking on the one instances, I get an emergency screen with
 ***System error handling failed****
VOMongoError: Lazy reference not found ...
 
Tommasso, do you get the same results?

I am curious about the solution.


***************This is the workspace of tommasso
repository dropDatabase.
repository := VOMongoRepository
host: 'localhost'
database: 'VoyageMongo-Link-Test-5'.
repository enableSingleton.

one := One new.
two := Two new.
three := Three new.

one link: two.
one link: three.

one save.
two save.
three save.

VOMongoRepository current reset.

One   selectAll  


View this message in context: Re: Voyage, Magritte descriptions, and nil exceptions
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-users] Voyage, Magritte descriptions, and nil exceptions

Sabine Manaa
Hi Norbert,
Aha! I unterstand. 
This is an interesting aspect. Fortunately I dont have this case at the moment. I will keep this in mind for the future.
Regards

Am Mittwoch, 9. März 2016 schrieb NorbertHartl [via Smalltalk] :
Sabine,

maybe my description wasn't clear enough. If you start to use voyage like that you have the constraint that all objects returned from the collection need to be the same or a subclass of the one you are using to search. Meaning

If you query

One selectAll

then all of the objects in the Numbers collection need to be the same class or a subclass of One. So this use case is at first only feasible if you want to find all instances of Numbers. Your basic query needs to be

Numbers selectAll

If you then want to deal only with instances of One you would need to add this to the query

Numbers selectMany: {
'#instanceOf' -> #One } asDictionary

This is not a nice approach but for this use case it should give you the desire result.

Norbert

Am 09.03.2016 um 10:52 schrieb Sabine Manaa <[hidden email]>:

Norbert, thank you. Ok, the Numbers collection name is clear.

If I use

<mongoContainer>
^ VOMongoContainer new
collectionName: 'Numbers';
yourself

the data is stored correctly in the Numbers collection in Mongo. Also the relationship is fine.
Everything fine till here.

But after 

VOMongoRepository current reset.

I have problems with fetching the data from mongo

If I define

mongoContainer
<mongoContainer>
^ VOMongoContainer new
enableMissingContent;
collectionName: 'Numbers';
"kind: self;"
yourself

Then I get the error "Bad object requested (Three does not inherits from One)"

If I define 

mongoContainer
<mongoContainer>
^ VOMongoContainer new
enableMissingContent;
collectionName: 'Numbers';
kind: self;
yourself

Then I get an Inspector with 3 instances of "One" (I refer to the workspace of the image from tommasso)
It should be only one instance of One
Clicking on the one instances, I get an emergency screen with
 ***System error handling failed****
VOMongoError: Lazy reference not found ...
 
Tommasso, do you get the same results?

I am curious about the solution.


***************This is the workspace of tommasso
repository dropDatabase.
repository := VOMongoRepository
host: 'localhost'
database: 'VoyageMongo-Link-Test-5'.
repository enableSingleton.

one := One new.
two := Two new.
three := Three new.

one link: two.
one link: three.

one save.
two save.
three save.

VOMongoRepository current reset.

One   selectAll  


View this message in context: Re: Voyage, Magritte descriptions, and nil exceptions
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-Magritte-descriptions-and-nil-exceptions-tp4882726p4883475.html
To start a new topic under Pharo Smalltalk Users, email <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;ml-node%2Bs1294792n1310670h65@n4.nabble.com&#39;);" target="_blank">ml-node+s1294792n1310670h65@...
To unsubscribe from Pharo Smalltalk Users, click here.
NAML