Hang while commiting objects with attribute as
MagmaCollection+index
Hilaire Fernandes
hilaire at ofset.org
Sun Jan 6 12:19:29 UTC 2008
Chris Muller a écrit :
>> IFIModels users add: user].
>
> Well, there you go. Isn't this referencing the entire, ever-growing
> database all in memory?
Really? I agree about the idea an of ever-growing database but IFIModels
users just return the #users branch of the database, which is a
MagmaCollection. Nothing special there.
What is special is that the added user objects contain itself two
indexed Magma collections, and the problem is related to that because if
I remove this part there are no problem.
Do you have test covering this case usage?
I try to read your test, not very easy to follow.
Hilaire
>
> "You gotta let go, Luke." ;-)
>
> Having said that, I am still experiencing some difficulty with memory
> "leaks" myself due to old stale MethodContexts not letting go of
> various references. It seems to be more of a Squeak problem that I
> don't fully understand yet.
>
>> Now I am wondering if creating empty indexed Magma collection could be a
>> problem or should the collection be populated first?
>
> No, either way should be no problem, and the test cases cover all the
> combinations IIRC. Look at #testMajorFunctions and
> #testAddIndexAndObjectsSimultaneously.
>
> - Chris
>
>
>
> On Jan 4, 2008 1:00 PM, Hilaire Fernandes <hilaire at ofset.org> wrote:
>> 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)
>> _______________________________________________
>> Magma mailing list
>> Magma at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/magma
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Magma mailing list
>> Magma at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/magma
More information about the Magma
mailing list