My point is not to use session, so I don't want to use <a href="http://ASP.NET">ASP.NET</a> sessions. <br>If I want to track sessions, your idea can be good, I would probably implement something similiar fo non Anonymous users... But in this case insead of pinging to keep session alive, I would just tell users to save data because of session expiration. It's WEB. Sessions Expire. Users must know it... well, this just my opinion! ...and pinging can lead to various security risks.<br>
<br>The problem is with anonymous users, that is for Web Site with maps served transparently to users by MapGuide.<br><br> "On an infinitely fast machine, MapGuide can serve an infinite number of
users."<br>..ok! I knew it! I must test!!! This was just to request if someone had made some tests and to share his/her experience....<br><br> "You cannot reference a class directly without referencing the dll (eg
MgException).<br> You can use a more generic try/catch to read the description without
knowing the type:<br>
try<br>
{<br>
//Bad code here<br>
}<br>
catch (Execption ex)<br>
{<br>
//Also catches MgExceptions and the like<br>
Console.Writeline(ex.Message);<br>
}"<br><br>What do you mena? I reference "MapGuideDotNetApi.dll". My problem is with "cross AppDomain calls". Refer to "<a href="http://winterdom.com/2007/01/makeexceptionclassesserializable">http://winterdom.com/2007/01/makeexceptionclassesserializable</a>" for an explanation.<br>
<br>"Btw., your attachment did not make it."<br>What does it means? You was not able to download my attach?<br><br>Anyway, thanks for your answer.<br><br>Regards pietro ianniello<br><br><div class="gmail_quote">
On Mon, Feb 22, 2010 at 5:03 PM, Kenneth Skovhede, GEOGRAF A/S <span dir="ltr"><<a href="mailto:ks@geograf.dk">ks@geograf.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
Instead of keeping sessions, and lists of sessions, how about this:<br>
<br>
Create a "start solution.aspx" that the anonymous users get a link to.<br>
In this file, simply log in as the anonymous user on MapGuide (or
whatever user you want to pose as anonymous).<br>
Redirect to the MapGuide viewer, passing SESSION=xxx to the solution,
using the session id you just created.<br>
<br>
You can then keep track of how many sessions there are active, using
the .Net session events:<br>
<a href="http://msdn.microsoft.com/en-us/library/ms178583.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms178583.aspx</a><br>
<br>
I recommend that you maintain a short session timeout, and "ping" an
aspx page to keep the session alive.<br>
<br>
The number of active users depend on hardware, the dataset, the user
behavior, etc.<br>
You can only determine this through testing. <br>
On an infinitely fast machine, MapGuide can serve an infinite number of
users.<br>
<br>
If you want something really fancy, MapGuide has some performance
counters you can poll.<br>
<br>
Yes, you should call dispose, and yes, it is annoying that you cannot
use using().<br>
You can create a trac ticket, stating what you want changed,<br>
to give a better .Net experience when acessing MapGuide:<br>
<a href="http://trac.osgeo.org/mapguide/wiki/SubmitTicket" target="_blank">http://trac.osgeo.org/mapguide/wiki/SubmitTicket</a><br>
<br>
Due to this problem (and other similar) problems, I have built the
MaestroAPI:<br>
<a href="http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI" target="_blank">http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI</a><br>
<br>
You cannot reference a class directly without referencing the dll (eg
MgException).<br>
You can use a more generic try/catch to read the description without
knowing the type:<br>
try<br>
{<br>
//Bad code here<br>
}<br>
catch (Execption ex)<br>
{<br>
//Also catches MgExceptions and the like<br>
Console.Writeline(ex.Message);<br>
}<br>
<br>
Btw., your attachment did not make it.<br>
<pre cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre><div><div></div><div class="h5">
On 22-02-2010 16:41, Pietro Ianniello wrote:
</div></div><blockquote type="cite"><div><div></div><div class="h5">
<p class="MsoNormal"><span lang="EN-US">Dear list,</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">This
question is for those who have knowledge of MagGuide internals.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">I want to
be able to give access to some maps to anonymous users, in a way
transparent to
their session [I mean that session seems not to expire to such users].</span></p>
<p class="MsoNormal"><span lang="EN-US">My idea is
to maintain a list of session ID on server side, let’s say 10. Then on
every
request I pick one of my sessions, check if it’s expired, if it is
recreate the
session, and then use it to serve the map.</span></p>
<p class="MsoNormal"><span lang="EN-US">NOTE: this
only for anonymous users, obviously!</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">I would like
to know:</span></p>
<p class="MsoNormal"><span lang="EN-US"><span>
</span>- What do you think of such a solution?</span></p>
<p class="MsoNormal"><span lang="EN-US"><span>
</span>- How can I calculate a good number of
server side maintained sessions?</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">The second
question can be reformulated: How many concurrent request is a SINGLE
MapGuide
server able to serve in a reasonable time…for a typical map, let’s say
for "<i>Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition</i>",
because it depends from the complexity of the map.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Then I
would like to pose some problems I have encountered using MapGide with <a href="http://ASP.NET" target="_blank">ASP.NET</a>,
witch are related to how managed classes are generated (using SWIG, I
suppose).</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">The first
is that Exceptions are not [Serializable] decorated, and don’t
implement the “Iserializable”
interface. So if someone uses MapGuide classes inside an assembly (as I
do), she
cannot catch OSGeo.MapGuide.ManagedException, OSGeo.MapGuide.</span><span lang="EN-US"> </span><span lang="EN-US">MgException,
etc….</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">The second
is releted to Dispose: all classes expose a Dispose function but don’t
expose
IDisposable interface, so we cannot use “using()”, but must always use
try/finally, wich, when there are many variables, can bring to ugly
code.</span></p>
<p class="MsoNormal"><br>
<span lang="EN-US"></span></p>
<p class="MsoNormal"><span lang="EN-US">This brigs me to the
following question: I always try to Dispose ALL AND EVERYTHING. Is it
correct? In my opinion if a class exposes a Dispose member, I MUST CALL
Dispose.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">A have
attached an <a href="http://ASP.NET" target="_blank">ASP.NET</a>
site with an example implementation of the server side
maintained sessions. It’s a little bit spaghetti, because it’s a
rewrite of a
different implementation… for example in the method
MgSheboyganCacheHelper.GetMgMapAnonymous
the MgSite is not disposed… but… should it be or when disposing the
related
Mgmap it will be automatically disposed [this relates to the Dispose
question
above]?</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,</span></p>
<p class="MsoNormal"><span lang="EN-US"><span> </span>Pietro
Ianniello </span></p>
</div></div><pre><fieldset></fieldset>
_______________________________________________
mapguide-users mailing list
<a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
</div>
<br>_______________________________________________<br>
mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Clausola di riservatezza: Le informazioni contenute in questo messaggio di posta elettronica e gli eventuali documenti allegati sono riservate e confidenziali ad uso esclusivo del destinatario e ne è vietata la diffusione e la riproduzione in qualunque modo eseguita. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invito ad eliminarlo ed a non leggerlo, dandone gentilmente comunicazione al mittente. I Dati sono trattati in accordo al D.lgs n° 196 del 30.06.2003 “Codice in materia dei dati personali”<br>