Hang while commiting objects with attribute as MagmaCollection+index

Hilaire Fernandes hilaire at ofset.org
Fri Jan 4 18:00:16 UTC 2008


I was wondering if the index should only be created after the collection 
is in the database. So I changed the test, with two commit: blocks and 
the learner object's magma collections and indexes created at the second 
commit.

testAddLearner
	| user |
	100 timesRepeat:
			[
			IFIDbSession commit:
					[user := IFILearner new.
					IFIModels users add: user].
			IFIDbSession commit: [user initLearningStates ; 
initPedagogicalMoments ]].
	self assert: IFIMagmaResource current school learners size = 100


But the result is the same.

Now I am wondering if creating empty indexed Magma collection could be a 
problem or should the collection be populated first?

Hilaire

Hilaire Fernandes a écrit :
> 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