I'm importing a lot of objects from a plain text file, and for some reason I don't understand I'm getting the #items item of my parent object inserted twice.
I have the class Route that has many RouteItems.
The importer code got somewhat convoluted, but basically what it does is:
glorpSession inUnitOfWorkDo: [:session |
[ stream atEnd ] whileFalse: [
route := Route new.
session register: route
route addItem: RouteItem new.
]
].
If I run a simplified version of the above code, it works ok. So the mappings are fine.
Something like:
glorpSession inUnitOfWorkDo: [ :session |
| route |
route := Route new.
session register: route.
route addItem: RouteItem new.
session register: route.
route := Route new.
session register: route.
route addItem: RouteItem new.
]
I can't understand what is causing the duplication of inserts in my "real" code.
Any clues?
Best regards,