<div dir="ltr">I have added OCI_THREADED to the flags passed to OciEnvCreate as per Andreas suggestion (and fixed a few compile warnings while at it).<div><br></div><div>You can checkout the changes:</div><div><br></div><div>
<a href="https://github.com/mapserver/mapserver/pull/4729">https://github.com/mapserver/mapserver/pull/4729</a><br></div><div><br></div><div>I'd like to merge this into master today, so I'd really appreciate it if someone could test it right away.</div>
<div>I'll be on #mapserver if you need assistance.</div><div><br></div><div>Ciao,</div><div>Umberto</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 13, 2013 at 7:08 PM,  <span dir="ltr"><<a href="mailto:Michel.Dastous@bentley.com" target="_blank">Michel.Dastous@bentley.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Andreas,<br>
<br>
Is it simple as adding a new flag? If so a compile switch could be added to enable it.<br>
<br>
Thanks<br>
<div class="im HOEnZb"><br>
-----Original Message-----<br>
From: Andreas Albarello [mailto:<a href="mailto:andreas.albarello@tol.bz.it">andreas.albarello@tol.bz.it</a>]<br>
Sent: Tuesday, August 13, 2013 12:19 PM<br>
To: Michel Dastous; <a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
Subject: RE: Mapserver thread safety<br>
<br>
On 12.08.2013 21:44, <a href="mailto:Michel.Dastous@bentley.com">Michel.Dastous@bentley.com</a> wrote<br>
</div><div class="im HOEnZb">> I've been testing mapserver and its c# mapscript API for a while now,<br>
> and I have noticed that making simultaneous Draw request on multiple<br>
> maps containing Oracle layer > will end up in memory corruption.  No<br>
> surprise here since maporaclespatial.c uses static variables (ordinates_tdo and ordinates).<br>
<br>
</div><div class="HOEnZb"><div class="h5">Michel,<br>
<br>
aside from the static variables in maporaclespatial.c there might be another issue at play here. Especially when using an Oracle 11g client, I've found it necessary to pass both OCI_OBJECT and OCI_THREADED to OCIEnvCreate (in msOCISetHandlers). I think right now there's still only OCI_OBJECT being passed to the mode parameter of OCIEnvCreate in maporaclespatial.c.<br>

<br>
See also <a href="http://docs.oracle.com/cd/B28359_01/appdev.111/b28395/oci16rel001.htm#i556149" target="_blank">http://docs.oracle.com/cd/B28359_01/appdev.111/b28395/oci16rel001.htm#i556149</a> and <a href="https://forums.oracle.com/thread/575746" target="_blank">https://forums.oracle.com/thread/575746</a> with the latter suggesting that one might need to use OCI_THREADED even if the application doesn't use the same environment handles across different threads which I think MapServer's connection pooling is already taking care of.<br>

<br>
Regards,<br>
--<br>
--------------------------------------------------------------------<br>
Andreas Albarello<br>
Analysis & SW Development<br>
<br>
Territorium Online srl/GmbH<br>
Via Buozzi Str. 12<br>
I 39100 Bolzano/Bozen<br>
<br>
Phone:  <a href="tel:%2B39%200471%20068611" value="+390471068611">+39 0471 068611</a><br>
Fax:    <a href="tel:%2B39%200471%20068619" value="+390471068619">+39 0471 068619</a><br>
<br>
email: <a href="mailto:andreas.albarello@tol.bz.it">andreas.albarello@tol.bz.it</a><br>
web:   <a href="http://www.tol.bz.it" target="_blank">http://www.tol.bz.it</a><br>
--------------------------------------------------------------------<br>
<br>
<br>
<br>
_______________________________________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
</div></div></blockquote></div><br></div>