Hang while commiting objects with attribute as MagmaCollection+index
Hilaire Fernandes
hilaire at ofset.org
Thu Jan 3 21:54:00 UTC 2008
While writing test I met the following problem:
I want to add hundred of (learner) object in a users MagmaCollection (it
is located in a branch of the DB and it has index too)
While looping, the commit becomes slower and slower until Squeak stall
at the 90th iteration. I know I can move the commit: in the outer block,
it is faster but still hang at the final commit time. The mouse icon is
then stuck to the write icon and the Squeak has to be brutally stopped.
In the Learner initialization if I remove the addIndex:, the process run
at a constant speed and finish.
It looks like a problem related to index creation.
testAddLearner
| user |
100 timesRepeat:
[user := IFILearner new.
IFIDbSession commit:
[IFIModels users add: user
"IFIMagmaResource current school addPerson: user"]]
self assert: IFIMagmaResource current school learners size = 100
IFILearner>>initialize
super initialize.
schoolYear := #CE2.
learningStates := MagmaCollection new.
learningStates
"addIndex: (MaCompetencyIndex attribute: #competency);"
addIndex: (MaFloatIndex attribute: #acquisitionLevel)
More information about the Magma
mailing list