Hi Amir,<div>did you define #= method on User ? </div><div><br></div><div>I guest that It&#39;ll look like this:</div><div><br></div><div><div>User &gt;&gt; = otherUser</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&quot;Answer whether the receiver is equal to the argument.&quot;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self class = otherUser class ifFalse: [^false].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^self name = otherUser name</div>
<div><br></div><div>You need implement the #hash method too:</div><div><br></div><div>User &gt;&gt; hash</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&quot;Answer a SmallInteger whose value is related to the receiver&#39;s identity.&quot;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^self name hash</div></div><div><br></div><div>Hope this help.</div><div><br></div>
<div>Facu</div><div><br></div><br><div class="gmail_quote">On Thu, Dec 30, 2010 at 10:24 AM, Amir Ansari <span dir="ltr">&lt;<a href="mailto:fractallyte@csi.com">fractallyte@csi.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I enter the following code in a Workspace:<br>
(the class &#39;User&#39; is just a very simple class with instance variable &#39;username&#39; and corresponding accessors)<br>
<br>
<br>
MagmaRepositoryController create: &#39;/testDB&#39; root: Dictionary new.<br>
<br>
initialSession := MagmaSession openLocal: &#39;/testDB&#39;.<br>
initialSession connectAs: &#39;admin&#39;.<br>
initialSession commit: [ initialSession root at: &#39;users&#39; put: MagmaPreallocatedDictionary new ].<br>
initialSession disconnect; closeRepository.<br>
<br>
newUser := User new username: &#39;Charlie&#39;; yourself.<br>
newSession := MagmaSession openLocal: &#39;/testDB&#39;.<br>
newSession connectAs: &#39;charlie&#39;.<br>
newSession commit: [ (newSession root at: &#39;users&#39;) at: newUser put: OrderedCollection new ].<br>
newSession disconnect; closeRepository.<br>
<br>
testSession := MagmaSession openLocal: &#39;/testDB&#39;.<br>
testSession connectAs: &#39;aUser&#39;.<br>
(testSession root at: &#39;users&#39;) size<br>
(testSession root at: &#39;users&#39;) at: newUser<br>
<br>
<br>
The last two lines indicate the problem: the size of the MagmaPreallocatedDictionary is reported correctly (even when I add more users), but when I try to access any of the entries with the &#39;User&#39; objects as keys, I get a &#39;errorKeyNotFound:&#39; error.<br>

<br>
Am I doing something wrong...?<br>
<br>
Amir<br>
_______________________________________________<br>
Magma mailing list<br>
<a href="mailto:Magma@lists.squeakfoundation.org">Magma@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/magma" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/magma</a><br>
</blockquote></div><br></div>