<br><font size=2><tt>Dear List</tt></font>
<br>
<br><font size=2><tt>We are using MapScript/Tomcat/Java/OracleSpatial.</tt></font>
<br>
<br><font size=2><tt>We use mapObj.mapClone() to get a fresh mapObject
</tt></font>
<br><font size=2><tt>in each request without reading the Mapfile.</tt></font>
<br>
<br><font size=2><tt>We detected problems after we activated Connection-Pooling:</tt></font>
<br><font size=2><tt>Tomcat crashed in mapObj.delete()</tt></font>
<br>
<br><font size=2><tt>Hole thing turned out to be a bug in mapcopy.c where</tt></font>
<br><font size=2><tt>the joins are copied:</tt></font>
<br><font size=2><tt>--------------------</tt></font>
<br><font size=2><tt>MS_COPYSTELEM(numjoins);</tt></font>
<br>
<br><font size=2><tt>for (i = 0; i &lt; dst-&gt;numprocessing; i++) {</tt></font>
<br><font size=2><tt>&nbsp; &nbsp;return_value = msCopyJoin(&amp;(dst-&gt;joins[i]),
&amp;(src-&gt;joins[i]));</tt></font>
<br><font size=2><tt>--------------------</tt></font>
<br>
<br><font size=2><tt>This must be changed to</tt></font>
<br><font size=2><tt>--------------------</tt></font>
<br><font size=2><tt>MS_COPYSTELEM(numjoins);</tt></font>
<br>
<br><font size=2><tt>for (i = 0; i &lt; dst-&gt;numjoins; i++) {</tt></font>
<br><font size=2><tt>&nbsp; &nbsp;return_value = msCopyJoin(&amp;(dst-&gt;joins[i]),
&amp;(src-&gt;joins[i]));</tt></font>
<br><font size=2><tt>--------------------</tt></font>
<br>
<br><font size=2><tt>There is some other code in mapobject.c, wich didn't
</tt></font>
<br><font size=2><tt>raise any problems for us, but from wich I do think
</tt></font>
<br><font size=2><tt>that array-allocs are missing.</tt></font>
<br><font size=2><tt>I watched the code an *think* these are are not allocated
</tt></font>
<br><font size=2><tt>anywhere. I hope, there is no misleading hint:</tt></font>
<br><font size=2><tt><br>
----------------------------<br>
// I do think, that dst-&gt;point is not allocated.<br>
// code seems to be unused (?)<br>
dst-&gt;numpoints = src-&gt;numpoints;<br>
for (i = 0; i &lt; dst-&gt;numpoints; i++) {<br>
 &nbsp;MS_COPYPOINT(&amp;(dst-&gt;point[i]), &amp;(src-&gt;point[i]));<br>
}<br>
----------------------------<br>
// I do think, that dst-&gt;items and dst-&gt;values is<br>
// not allocated<br>
MS_COPYSTELEM(numitems);<br>
for (i = 0; i &lt; dst-&gt;numitems; i++) {<br>
 &nbsp;MS_COPYSTRING(dst-&gt;items[i], src-&gt;items[i]);<br>
 &nbsp;MS_COPYSTRING(dst-&gt;values[i], src-&gt;values[i]);<br>
}<br>
<br>
-----------------------------<br>
// I'm quite shure, that dst-&gt;items is not allocated<br>
MS_COPYSTELEM(numitems);<br>
<br>
for (i = 0; i &lt; dst-&gt;numitems; i++) {<br>
 &nbsp;MS_COPYSTRING(dst-&gt;items[i], src-&gt;items[i]);<br>
}<br>
</tt></font>
<br><font size=2><tt>I hope this is helpful. Greetings</tt></font>
<br><font size=2><tt>Benedikt Rothe</tt></font>