beautypg.com

Pitney Bowes MapXtreme User Manual

Page 123

background image

Chapter 6: Understanding State Management

A Closer Look at the MapXtreme Session

MapXtreme v7.1

123

Developer Guide

When the application starts, a request is made to the application pool for a MapXtreme Session
object. The COM+ pool then creates the number of pooled objects you specified in the control panel
Component Services dialog box. This MapXtreme Session object reads the Web.config file, and the
specified workspace is loaded before your application gets an instance from the pool. Therefore, if
loading the workspace takes more time than the time-out specified in the Component Services
dialog box, you will receive a COM+ activation exception. So it is important to understand what you
are loading in this workspace and how long it will take to completely load.

If you specified a Minimum Pool Size of 2, then the COM+ pool will create both copies of the
MapXtreme Session instance on the first request for a pooled object. When the COM+ pool senses
a time-out waiting for a pooled object, it will create more objects up to the maximum setting. If your
workspace is very complex and takes a great deal of time to load, then the activation of subsequent
objects may cause time-out errors when the application is active. The web application pool has
settings to control the reactivation of pooled applications, including settings for recycling the pooled
classes. So at some point your application and the pooled objects may be recycled, and this will
cause another workspace loading.

You must decide which maps, tables, and layers are important to have as the background for your
application, and load these via the workspace in the Web.config file, But be aware of the implications
of a large workspace that takes time to load. To test your load time, simply load the workspace in
Workspace Manager on the server machine to determine the actual load time and adjust your time-
out setting accordingly.

Initial workspaces are very useful in loading maps, layers, and tables that do not change from user
to user, but you have to be aware of the implications of loading complex workspaces.

Further Reading

The MapXtreme Session is highly configurable and is designed to work in conjunction with Microsoft
COM+ and web technologies. To better understand how best to use this, you need to understand the
Microsoft web delivery architecture. There are many places to get more information on the topics
listed above. Here are some links to very good information on web architecture:

COM+ pooling

COM+ Object Pooling Concepts

IIS 7.0

IIS 7.0: Managing Web Applications in IIS 7.0

IIS 6.0

Internet Information Services

IIS Session state

Selecting the Method for Maintaining and Storing ASP.NET Session
State (IIS 6.0)