<html>
<body>
<font size=3>In general, if you've got objects from different sessions,
then yes, you're going to have to read it for the current session, or
fake around it in interesting ways. It seems like the issue is why you're
getting a different Glorp session for each Ajax request. I haven't looked
at the details of the code, but I'm guessing that the mode it's operating
in is that each http request is getting a separate glorp session and
releasing it back to the pool again immediately, or just discarding it,
and when an ajax request comes in it's being treated as a separate
request, and getting a new session. So what you'd want to do is keep the
Glorp session associated with the Seaside session, and re-use it for each
request that comes in. You'd presumably want to make sure you're pooling
the underlying database connections then, but that's fine. The details of
that, and whether the framework already lets you do that are left as an
exercise to the reader, as I'm in Barcelona enjoying myself prior to the
start of ESUG :-) <br><br>
At 02:27 PM 2010-09-10, Bart Veenstra wrote:<br>
<blockquote type=cite class=cite cite="">And another thing is bugging me
during the development.<br><br>
How do I cope with glorp objects that are stored in a WAComponent, like
the current user, and use that when I update other glorp objects. It
keeps pushing me a DuplicatePrimaryKeyException because the object is not
in the current session. I need to reinstantiate the current user in the
session with a database lookup, before I can use it again...<br><br>
So, How to properly mix glorp objects coming from different sessions?
This could be resolved, if the glorpFilter stays put in the WASession in
each ajax request. <br><br>
Should I drop the glorp filter and put the glorp session in the WASession
properties instance variable?<br><br>
Regards,<br><br>
Bart<br><br>
<br><br>
2010/9/10 Bart Veenstra
&lt;<a href="mailto:bart.veenstra@gmail.com">bart.veenstra@gmail.com</a>
&gt;<br>
</font>
<dl>
<dd>Hi,<br><br>

<dd>I am working on an Ajax heavy application with Glorp as my mapping
framework. I use the Glorp filter to assign a glorpSession to my database
objects. This works pretty well, but it seems that for each request
within the same session (like an jQuery ajax callback) a new GlorpSession
is created. <br><br>

<dd>When removing all sessions using WAAdmin clearAll, the Glorp Sessions
still remain in the memory, (Checked with GlorpSession
allInstances).<br><br>

<dd>Should I worry about this? And how do I get rid of the GlorpSessions?
<br><br>

<dd>I tried GlorpSession allInstances do: [:each | each become:nil ] but
the object is immutable...<br><br>

<dd>Using VW 77 with the latest seaside from the public
repository.<br><br>

<dd>Regards,<br><br>

<dd><font size=3 color="#888888">Bart Veenstra<br>
</font><br>

</dl><br>
_______________________________________________<br>
seaside mailing list<br>
seaside@lists.squeakfoundation.org<br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" eudora="autourl">
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
</blockquote></body>
<br>
<div>--</div>
<div>Alan Knight [|], Engineering Manager, Cincom Smalltalk</div>
<div>knight@acm.org</div>
<div>aknight@cincom.com</div>
<div><a href="http://www.cincom.com/smalltalk" EUDORA=AUTOURL>
http://www.cincom.com/smalltalk</a></div>
</html>