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