Murty,<br><br><br>I&#39;ve investigated the problem it seems having the same name for each connection causes that the same connection is used from the connection pool when opening the second layer by the OGR driver. But if you close the first layer before opening the second it should work correctly then, like:<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string mapfile1 = Path.Combine(Application.StartupPath,&nbsp; @&quot;..\..\mapfile1.map&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mapObj map1 = new mapObj(mapfile1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layerObj lyr1 = map1.getLayer(0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lyr1.open();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string field1 = lyr1.getItem(0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 0, 0);">lyr1.close();</span><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string mapfile2 = Path.Combine(Application.StartupPath, @&quot;..\..\mapfile2.map&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mapObj map2 = new mapObj(mapfile2);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layerObj lyr2 = map2.getLayer(0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lyr2.open();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string field2 = lyr2.getItem(0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb(255, 0, 0);"> lyr2.close();</span><br>
<br>Best regards,<br><br>Tamas<br><br><br><br><div class="gmail_quote">2009/2/18 Murty Maganti <span dir="ltr">&lt;<a href="mailto:MMaganti@oriongis.com">MMaganti@oriongis.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Hi</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">I have posted the test application. But the email is waiting for
approval of moderator (as the attachment size is 75 KB and I think allowed is
only 40 KB). </span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Thanks</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Murty</span></p>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">

<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> Tamas Szekeres
[mailto:<a href="mailto:szekerest@gmail.com" target="_blank">szekerest@gmail.com</a>] <br>
<b>Sent:</b> Tuesday, February 17, 2009 6:33 PM<div class="Ih2E3d"><br>
<b>To:</b> Murty Maganti<br>
<b>Cc:</b> <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [mapserver-users] Problem with loading map file using C#
map script</div></span></p>

</div>

<p>&nbsp;</p>

<p style="margin-bottom: 12pt;">Hmmm. I haven&#39;t found such an
issue before.</p><div><div></div><div class="Wj3C7c"><br>
If you could post an example that would be helpful to reproduce this.<br>
<br>
Best regards,<br>
<br>
Tamas<br>
<br>
<br>
</div></div><div><div></div><div class="Wj3C7c">

<div>

<p>2009/2/18 Murty Maganti &lt;<a href="mailto:MMaganti@oriongis.com" target="_blank">MMaganti@oriongis.com</a>&gt;</p>

<div>

<div>

<p>Hi </p>

<p>&nbsp;</p>

<p>I have a issue loading a map file through map script and need help.</p>

<p>&nbsp;</p>

<p>I have two map info (tab) files with same name but in two different folders.
I have two map files each containing each layer. I am loading these map files
using C# map script (each map file is loaded in to a separate mapObj on a
separate thread). At run time, when I debug the second mapObj, the layer has
items (layerObj.getItem()) from the first layer loaded by the first map file. I
verified &#39;shapepath&#39; on mapObj and it is pointing to correct path. There is
nothing wrong there. I am surprised how is it caching the item info, just by
the file name (file name is same but they are completely from different
folders).</p>

<p>&nbsp;</p>

<p>When I load the map file one more time (again a different .Net thread, it
shows up correct fields).</p>

<p>&nbsp;</p>

<p>Within my app (Asp.Net), I can consistently replicate this.</p>

<p>&nbsp;</p>

<p>Thanks</p>

<p>Murty</p>

<p>&nbsp;</p>

</div>

</div>

<p style="margin-bottom: 12pt;"><br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a></p>

</div>

<p>&nbsp;</p>

</div></div></div>

</div>


</blockquote></div><br>