Hi,

I have a strange problem and before searching for more hours, I want to ask,
if this problem is known.
If not, I will proceed by myself ;-)

Background:
I write currencies and countries into mongo with voyage.
For database creation, first I create all currencies and countries of the
world in the image.
One Country has N currencies and one Currency has N countries.
After creating the model objects in the image, I save them to mongo with
voyage then.

Problem:
Here something strange happens. SOMETIMES, the OID to the Currencies
collection is wrong! It is the OID of the object itself (the country).
Please see the example of UnitedArabEmirates below to understand what I
mean. The OID of the country UAE is the same as the pointer to the
currency(!). But in the model objects in my image, the inst var currencies
was NOT pointing to the country itself but to the currency.

{
   "#version": NumberInt(466896549),
   "_id": ObjectId("a5466c0b0000000000000000"),
   "countryName": "labelCountryUnitedArabEmirates",
   "currencies": {
     "0": {
       "#collection": "Currencies",
       "__id": ObjectId("a5466c0b0000000000000000") 
    } 
  },
   "iso3166": "ARE" 
}       
 

this is an example of a country which is correct.
 
{
   "#version": NumberInt(228627064),
   "_id": ObjectId("b7956c0b0000000000000000"),
   "countryName": "labelCountryArgentina",
   "currencies": {
     "0": {
       "#collection": "Currencies",
       "__id": ObjectId("77926c0b0000000000000000") 
    } 
  },
   "iso3166": "ARG" 
}       
 

The important point is: this happens randomly. I take the one fresh loaded
image, create the objects into the database and close the image without
saving. The next time, other countries are wrong. If I delete the wrong
objects from the database and re-create them, they are correct.

I was trying to save the objects with delays but this did noch change
anyting.

I want to find out, what the reason for that is and ask you if you had
similar problems or if this is a known bug....

any hint appreciated.

Sabine
 




--
View this message in context: 
http://forum.world.st/voyage-mongo-randomly-wrong-OIDs-tp4705396.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to