Pitney Bowes MapXtreme User Manual

Page 109

Advertising
background image

Chapter 6: Understanding State Management

InProc Development Model

MapXtreme v7.1

109

Developer Guide

7. The user clicks on the Select tool, and then clicks on the portion of the map that shows Australia.

8. On the server, the application performs a selection: to select the Australia region. A new map

image is rendered, to display the new selection.
There are now two ways the Map's status has changed from its original state: Its center and
zoom changed (in step 6), and now there is a Selection.

9. Elsewhere, a second user launches a browser and goes to your mapping application web site. A

new MapXtreme Session is created on your server for the second user. This session contains a
map, which shows the entire world. This Map object is separate from the first user's Map.

Note that the second user sees a map of the world, rather than a map that is zoomed in on Australia.
Only the first user's map is zoomed in on Australia. A second MapXtreme Session (with its own map)
was created to service the requests from the second user. Thus the second user will not see the
same map as the first user.

Configuring an Application to Use the InProc Development Model

The Web.config file for your web application holds the settings to control the application model. For
the InProc model the Web.config file settings are:

<!--Use this setting to turn Session pooling on/off (true/false)-->
<add key="MapInfo.Engine.Session.Pooled" value="false" />

<!--Use this setting to save Session state automatically
(HttpSessionState) or manually (Manual)-->
<add key="MapInfo.Engine.Session.State" value="HttpSessionState" />

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;userid=sa;password="
cookieless="false" timeout="20" />

These settings specify that the MapInfo.Engine.Session object is not pooled, and the state of the
MapXtreme Session object is automatically stored in the user’s HTTP Session (key value =
HttpSessionState).

In the sessionState element, we have set the mode attribute to InProc to specify that everything is
saved in process. InProc is the default mode if sessionState is not specified.

The lifetime of the MapXtreme Session instance depends on the Session state configuration. The
MapXtreme Session instance is cached in memory for the lifetime of your ASP.NET session when
you use server-based Session State and the ASP.NET sessionState element in your Web.config file
is set to InProc.

If you use any other type of Session State configuration (for example, client-based or server-based
with sessionState element set to StateServer or SQLServer), the MapXtreme Session instance is
created and disposed for each ASP.NET request. However, this has performance implications and
should be avoided as a development model. If you follow the InProc model, sessionState should be
set to InProc.

Advertising