Thanks Ron and Alan, I shall try to implement what you have suggested and comeback to you when done( commit) or having problems again(Rollback)&nbsp; ;-)<br><br><br><br><div><span class="gmail_quote">On 8/13/07, <b class="gmail_sendername">
Alan Knight</b> &lt;<a href="mailto:knight@acm.org">knight@acm.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<font size="3">In general, if you have a unit of work in progress, then any
objects you read during that unit of work will be registered
automatically. Registering more than once should do no harm, as long as
the object was registered before it was modified.<br><br>
I don&#39;t know why you would be having that particular problem, but I don&#39;t
know exactly what the methods commit: and and the callback does. It would
depend on the flow of control. If seaside is blocking, then the unit of
work won&#39;t have committed, so I would expect the changes to be seen.
However, if Seaside lets your process keep going when you register the
callback, then presumably it will have already fallen through, and
committed the unit of work before any changes were made.<br><br>
So you&#39;d need to either be using Seaside API&#39;s that &quot;block&quot; the
calling process. Or you&#39;d need to begin the unit of work here, and commit
it explicitly later. So, for example, I think it might work if you put
the call to commit the unit of work in the callback for the submit
button. Although you might have to do some fiddling in case it gets
called more than once due to continuations or other mechanisms.</font><div><span class="e" id="q_1145fb95c7368447_1"><font size="3"><br><br>
At 12:53 PM 8/12/2007, Rajeev Lochan wrote:<br>
</font><blockquote type="cite"><font size="3">Hi Ron,<br>
I tried to implement what you hinted, no progress.<br><br>
I changed my code to <br><br>
html<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; form: [self session<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
commit: [temp := self session<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
readOneOf: BlogPost <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
where: [:each | each persistentId = &#39;1&#39;].<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
self session register: temp.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
html textInput value: temp title;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
callback: [:value | temp title: value].<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
html submitButton<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
callback: [self session register: temp];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
text: &#39;Update&#39;]] <br><br>
<br>
I am registering before change as you said, but doesnt change the title.
(I am registering twice though)<br><br>
<br>
But, even if I dont register the object, before changing. It does update
if I use normal setter technique. (Snippet below) <br><br>
html<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; form: [self session<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
commit: [temp := self session<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
readOneOf: BlogPost<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
where: [:each | each persistentId = &#39;1&#39;]. <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
temp title: &#39;some Title&#39;.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
html submitButton<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
callback: [self session register: temp];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
text: &#39;Update&#39;]]<br><br>
<br><br>
<br>
In Glorp Tutorial by Roger Whitney, he updated in just unitOfWork and
also without registering it.<br><br>
&quot;&nbsp;&nbsp; A UnitOfWork will keep track of the changes we make in
objects. The following will retrieve a <br>
person, change the first name of person and then write the changes back
to the database.<br><br>
session beginUnitOfWork.<br>
foundPerson := session readOneOf: Person where: [:each | each firstName =
&#39;Jose&#39;]. <br>
foundPerson firstName: &#39;RamJet&#39;.<br>
session commitUnitOfWork<br><br>
When we start a UnitOfWork it records all the objects we read from the
database. When the<br>
UnitOfWork is committed it writes all the changed objects back to the
database.&quot;<br><br>
<br>
As much I understand, it has something to do with <br>
self session commit:[ ........... html textInput value: callback:
...........] <br><br>
<br>
BTW, I am not using Magritte in my proposed application. So Ramon&#39;s
Active Record for Magritte would possibly not help me much.<br><br>
Thanks in advance.<br><br>
<br>
On 8/12/07, <b>Ron Teitelbaum</b>
&lt;<a href="mailto:Ron@usmedrec.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Ron@usmedrec.com</a></font></blockquote></span></div><div><span class="e" id="q_1145fb95c7368447_3">&gt;
wrote:<br>

<dl><br>

<dd><font color="#000080" size="2">Hi Rajeev,<br>
</font><font size="3"><br>
</font>
</dd><dd><font color="#000080" size="2">&nbsp;<br>
</font><font size="3"><br>
</font>
</dd><dd><font color="#000080" size="2">You need to register the object before
you make changes to it.&nbsp; The registration tells Glorp to track
changes to your object. <br>
</font><font size="3"><br>
</font>
</dd><dd><font color="#000080" size="2">&nbsp;<br>
</font><font size="3"><br>
</font>
</dd><dd><font color="#000080" size="2">Hope that helps!<br>
</font><font size="3"><br>
</font>
</dd><dd><font color="#000080" size="2">Ron Teitelbaum<br>
</font><font size="3"><br>
</font>
</dd><dd><font color="#000080" size="2">&nbsp;<br>
<hr>
<div align="center"></div></font></dd></dl></span></div></div>

<dd><div><span class="e" id="q_1145fb95c7368447_5"><font face="Tahoma" size="2">From:
<a href="mailto:seaside-bounces@lists.squeakfoundation.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
seaside-bounces@lists.squeakfoundation.org</a>
[<a href="mailto:seaside-bounces@lists.squeakfoundation.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
mailto:seaside-bounces@lists.squeakfoundation.org</a>] On Behalf Of
Rajeev Lochan<br>

<dd>Sent: Sunday, August 12, 2007 11:52 AM<br>

</dd><dd>To: Seaside - general discussion<br>

</dd><dd>Subject: [Seaside] Glorp-Seaside-callback not Working<br>
</dd></font><font size="3"><br>
</font>
</span></div></dd><dd><font face="Times New Roman, Times" size="3">&nbsp;<br>
</font><br>

</dd><dd><div><span class="e" id="q_1145fb95c7368447_7"><font face="Times New Roman, Times" size="3">Dear Seasiders,<br>

<dd>I followed Ramon&#39;s Blog of porting seaside to postgreSQL using Glorp.
<br>

</dd><dd>I have now created 2 components. In one, you can enter the details of
the form (which are in the form of textInput and textArea) and are
registered upon submitting a button. This part works well. <br><br>

</dd><dd>Now, in the second component, I want to edit(update) the entries I
have created earlier. I use textInput and textArea again for this, and
when I edit and submit using a button (register the model) , the update
doesnt seem to work. <br><br>

</dd><dd>I have observed one thing here, the update doesnt seem to work in
textInput value: callback:<br><br>

</dd><dd>A snippet is code is here.(which doesnt update the title)<br><br>
<br>

</dd><dd>self session<br>

</dd><dd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; commit: [temp := self
session <br>

</dd><dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
readOneOf: BlogPost<br>

</dd><dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
where: [:each | each title = &#39;1&#39;].<br>

</dd><dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
html textInput value: temp title;<br>

</dd><dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
callback: [:value | temp title: value]. <br>

</dd><dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
self session register: temp]<br><br>
<br><br>

</dd><dd>A snippet which uses simple setter technique and is updated.<br><br>

</dd><dd>self session<br>

</dd><dd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; commit: [temp := self
session<br>

</dd><dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
readOneOf: BlogPost<br>

</dd><dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
where: [:each | each title = &#39;1&#39;].<br>

</dd><dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
temp title: &#39;some Title&#39;.<br>

</dd><dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
self session register: temp].<br><br>
<br><br>

</dd><dd>Anticipating your help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br>
<br><br>
<br>

</dd><dd>-- <br>

</dd><dd>Rajeev Lochan<br><br>

</dd><dd>Co-founder, AR-CAD.com<br><br>

</dd><dd><a href="http://www.ar-cad.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.ar-cad.com</a><br>

</dd><dd>+91 9243468076 (Bangalore)<br>

</dd><dd>080 65355873 <br>
</dd></font><br>

</span></div></dd><dd>_______________________________________________<br>

</dd><dd>Seaside mailing list<br>

</dd><dd><a href="mailto:Seaside@lists.squeakfoundation.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Seaside@lists.squeakfoundation.org </a><br>

</dd><dd><div><span class="e" id="q_1145fb95c7368447_9">
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
 </a><br><br>

<br><br>
<br>
-- <br>
Rajeev Lochan<br><br>
Co-founder, AR-CAD.com<br><br>
<a href="http://www.ar-cad.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.ar-cad.com</a><br>
+91 9243468076 (Bangalore)<br>
080 65355873 <br>
_______________________________________________<br>
Seaside mailing list<br>
<a href="mailto:Seaside@lists.squeakfoundation.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>

<br>
<div>--</div></span></div><span class="sg">
<div>Alan Knight [|], Cincom Smalltalk Development</div>
<div><a href="mailto:knight@acm.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">knight@acm.org</a></div>
<div><a href="mailto:aknight@cincom.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">aknight@cincom.com</a></div>
<div><a href="http://www.cincom.com/smalltalk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.cincom.com/smalltalk</a></div>

</span></dd><br>_______________________________________________<br>Seaside mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Seaside@lists.squeakfoundation.org">Seaside@lists.squeakfoundation.org
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Rajeev Lochan<br><br>Co-founder, AR-CAD.com<br><br><a href="http://www.ar-cad.com">http://www.ar-cad.com</a><br>+91 9243468076 (Bangalore)<br>080 65355873