Hi Chris, I read the ReadStrategy FAQ and it's quite interresting. I have some question though. First of all, how long will the read strategy last for a given session by doing mySession 'session readStrategy: myReadStrategy.' ? Do I have to revert it back to a default strategy after my specific queries ? Then is it possible to be more specific. For example : my Players have a reference to a Dungeon which references a Desk which has two OrderedCollection referencing Letters. If I want to send a Letter to 10 Players, I need to had a Letter in each of their Desk, resulting of a huge query I think. Is there a way to be so much specific with a ReadStrategy ? By doing such a query, my understanding is that the other referenced objects of the Dungeons won't be materialized. Am I right ?
Florian
Florian Minjat wrote:
Great ! I knew there were already something like that in Magma. I will test it soon. It should speed up the listing of the players considerably. Thanks !
Florian
Chris Muller wrote:
Yes, I think you are asking about ReadStrategy's. They are crucial to getting proper performance out of Magma. Here is the information about ReadStrategy's you must understand:
http://wiki.squeak.org/squeak/2638
On 6/12/07, Florian Minjat florian.minjat@emn.fr wrote:
I have another question : if I ask magma for an object Player which references others Players in its Letters, will magma deserialize all the referenced players ? If it is the case, is there a way to ask for an 'half-deserialization' ? By that I mean for example getting the referenced Players with all their primitive objects but no referenced object ? Otherwise I will need to seriously rethink the Mailbox/Letter model of my application.
Florian
Chris Muller wrote:
Hi Florian, this is an interesting problem.
First to answer your question, Magma identifies an object as already in the repository if it has a "permanent" oid. This is an oid range between MaOidCalculator #firstUserObjectOid and #lastUserObjectOid. The #hash of an object never comes into play to determine this, or anything in Magma for that matter.
One way to get your large object-model into Magma would be to change the method MaObjectBuffer>>#ensureSpaceFor: to allow more than 10 megabyte serializations. I only suggest this only because it is an arbitrary limit and it looks like your model is right there just over the limit. Change it to 50-meg on the fastest computer you have, It should work. Submit the commit and let it run all night.
Another option would be to temporarily change your Players to reference the other players only logically; by some temporary id or something. Once you get them loaded into Magma, then reset the references back to the actual objects.
Note #maTransientVariables is available to implement on Player so it will not serialize those variables, so you could actually ADD a new logical reference, if necessary, and make the hard player reference transient (temporarily).
Please let me know if these ideas are feasible.
- Chris
On 6/10/07, Florian Minjat florian.minjat@emn.fr wrote:
Hi, I am trying to transfer a big object hierarchy to Magma : 110100 objects in 9004144 bytes. The basic structure is composed of ~70 Players with a lot of stuff inside. Each players can have some Letters which references other Players as sender or recipients. The problem is that I can't submit one player to an empty Magma repository without letting Magma insert all the references Players. And the resulting transaction is too big, causing an error. So I separated all the Letters from the Players, inserted the players (~50min) and then tried to insert the Letters. But I close the connection to the magma repository between the two, so Magma tried again to load all the references Players. So here is my question : how does Magma identify a given object as already inside a repository ? Does it compare the hash of the objects and I just need to redefine the hash method of Players ? Each try is quite long so I would like to understand a little more of the inner mechanisms of Magma instead of trying numerous times.
Florian _______________________________________________ Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma