<br><font size=2 face="sans-serif">Hello Umberto</font>
<br>
<br><font size=2 face="sans-serif">Thank you for yout hint's!</font>
<br>
<br><font size=2 face="sans-serif">You are right: One should be cautios.
But for the moment I have the impression</font>
<br><font size=2 face="sans-serif">that we seeme to have found a way, which
don't raise obvious errors in the first </font>
<br><font size=2 face="sans-serif">moment :-)</font>
<br>
<br><font size=2 face="sans-serif">After the mentioned changes in mapcopy.c
the approache </font>
<br><font size=2 face="sans-serif">(TomCat/MapScript/Connection-Pooling/MapCloning)
seeme to </font>
<br><font size=2 face="sans-serif">work for us. (Working with Version 4.6)</font>
<br>
<br><font size=2 face="sans-serif">But:</font>
<br><font size=2 face="sans-serif">- We do need some more stress-testing.(We
already made automated </font>
<br><font size=2 face="sans-serif"> http-requests from a Java-Programs.
But this was definitly not enough and </font>
<br><font size=2 face="sans-serif"> not "nasty" enough!)</font>
<br><font size=2 face="sans-serif">- New problems could raise, if more
or other features from mapserver/mapscript</font>
<br><font size=2 face="sans-serif"> are used then we actualy do.
</font>
<br><font size=2 face="sans-serif">- Memory footprint of the running-tomcat
has to be watched!. What about the size </font>
<br><font size=2 face="sans-serif"> of the application after
100, 500, 600, 800 ... requests? (I'm not quite shure how to do this!</font>
<br><font size=2 face="sans-serif"> Watching Java-Programs
is difficult because of garbage-collections ...)</font>
<br>
<br><font size=2 face="sans-serif">Greetings</font>
<br><font size=2 face="sans-serif">Benedikt</font>
<br>
<br><font size=2><tt>Umberto Nicoletti <umberto.nicoletti@gmail.com>
schrieb am 29.06.2005 11:03:46:<br>
<br>
> On 6/29/05, Benedikt Rothe <umn-ms@hydrotec.de> wrote:<br>
> > <br>
> > Dear List <br>
> > <br>
> > We are using MapScript/Tomcat/Java/OracleSpatial. <br>
> > <br>
> > We use mapObj.mapClone() to get a fresh mapObject <br>
> > in each request without reading the Mapfile. <br>
> <br>
> Benedikt,<br>
> I would not do that (tm). In my apps I recreate a fresh mapObj with<br>
> each request as the overhead is mininum and the benefits high
(so<br>
> that the ratio is in favor of this approach).<br>
> Besides this is the only known method to work (as far as I know) and<br>
> this stems from the fact that mapserver was in the beginning (and<br>
> still is, with improvements) a CGI. As you might know cgis are<br>
> processes that are created by the web server to serve a single request<br>
> and then exit, so memory cleanup and thread safety are non-issues
for<br>
> them.<br>
> Even in php mapscript php must be used as a cgi (instead of a DSO)
to<br>
> make sure that it works.<br>
> <br>
> > <br>
> > We detected problems after we activated Connection-Pooling: <br>
> > Tomcat crashed in mapObj.delete() <br>
> ><br>
> <br>
> I would not use connection pooling just because it will not work<br>
> reliably with Java Servlets for the reasons explained above.<br>
> <br>
> This matter (connection pooling and map cloning) surely requires<br>
> deeper investigation, one of the developers coul step in to give his<br>
> opinion on my statements (which I would sincerely hope were false,
but<br>
> fear not). Btw, I seem to recall that the above issues (long lived<br>
> instance against per request instance) were already discussed
on the<br>
> list before.<br>
> <br>
> Best regards,<br>
> Umberto<br>
> <br>
> > Hole thing turned out to be a bug in mapcopy.c where <br>
> > the joins are copied: <br>
> > -------------------- <br>
> > MS_COPYSTELEM(numjoins); <br>
> > <br>
> > for (i = 0; i < dst->numprocessing; i++) { <br>
> > return_value = msCopyJoin(&(dst->joins[i]),
&(src->joins[i])); <br>
> > -------------------- <br>
> > <br>
> > This must be changed to <br>
> > -------------------- <br>
> > MS_COPYSTELEM(numjoins); <br>
> > <br>
> > for (i = 0; i < dst->numjoins; i++) { <br>
> > return_value = msCopyJoin(&(dst->joins[i]),
&(src->joins[i])); <br>
> > -------------------- <br>
> > <br>
> > There is some other code in mapobject.c, wich didn't <br>
> > raise any problems for us, but from wich I do think <br>
> > that array-allocs are missing. <br>
> > I watched the code an *think* these are are not allocated <br>
> > anywhere. I hope, there is no misleading hint: <br>
> > <br>
> > ----------------------------<br>
> > // I do think, that dst->point is not allocated.<br>
> > // code seems to be unused (?)<br>
> > dst->numpoints = src->numpoints;<br>
> > for (i = 0; i < dst->numpoints; i++) {<br>
> > MS_COPYPOINT(&(dst->point[i]), &(src->point[i]));<br>
> > }<br>
> > ----------------------------<br>
> > // I do think, that dst->items and dst->values is<br>
> > // not allocated<br>
> > MS_COPYSTELEM(numitems);<br>
> > for (i = 0; i < dst->numitems; i++) {<br>
> > MS_COPYSTRING(dst->items[i], src->items[i]);<br>
> > MS_COPYSTRING(dst->values[i], src->values[i]);<br>
> > }<br>
> > <br>
> > -----------------------------<br>
> > // I'm quite shure, that dst->items is not allocated<br>
> > MS_COPYSTELEM(numitems);<br>
> > <br>
> > for (i = 0; i < dst->numitems; i++) {<br>
> > MS_COPYSTRING(dst->items[i], src->items[i]);<br>
> > }<br>
> > <br>
> > I hope this is helpful. Greetings <br>
> > Benedikt Rothe<br>
</tt></font>