Using COM+ Pooling

Creating a Pooled Object

To obtain a PooledObject object, create a new PooledObject object by using COM. The COM+ interceptors detect the new object and manage the pooled objects. The PooledObject object has been written to support the COM+ pooling mechanism.
For an example, see Example Code Using COM+ Pooling .

Administering COM+ Pooling

To administer a COM+ pool, use the COM+ Component Services administrative tool, which is a standard Microsoft Management Console (MMC) plug-in that ships with Windows 2000.
You can configure COM+ pools in these two different ways:
  • library application -- each process has its own pool
  • server application -- the pool is shared by all processes on the same machine
To create a new COM+ server application, perform the following steps:
  1. Start the Component Services administrative tool by selecting Startthen selectProgramsthen selectAdministrative Toolsthen selectComponent Services.
  2. Expand Component Servicesthen selectComputerthen selectCOM+ Applications. Right-click COM+ Applications and select Newthen selectApplication. This starts a wizard. Click Next.
  3. Select Create an Empty Application.
  4. Enter a name of your choice, and select Server application as the Activation Type. Click Next.
  5. Specify an identity, and click Next.
  6. Click Finish.
To add the PooledObject component to the application, perform the following steps:
  1. Expand the application that you previously created in order to see Components and Roles.
  2. Right-click Components and select New Component, which brings up a wizard.
  3. Click Next, and then select Import components that are already registered.
  4. Select SASObjectManager.PooledObject.1, and then click Next and Finish.
To administer the pooling properties, perform the following steps:
  1. Right-click SASObjectManager.PooledObject.1 under the Components node of the application that you created, and select Properties from the pop-up menu.
  2. Select the Activation tab.
  3. Select the Enable object pooling check box. Enter the properties.
  4. (Optional) You can also enter a constructor string, which enables you to specify which machine SAS should run on. For more information, see Constructor Strings .
    Note: If you do not specify a constructor string, then the SAS Object Manager creates workspaces on the local machine by using COM. It is necessary to configure a metadata server with pooling metadata only if you specify a logicalName.

Constructor Strings

The constructor string is a single string that specifies the parameters that are used to initially create the pool. The object manager requires that the constructor string contain a set of name and value pairs, with the names separated from the values by an equal sign (=), and the pairs separated by a semicolon (;). If no parameters are specified, then a pool that consists of SAS servers running on the local machine is created. You should never use quotation marks (") in the constructor string. The constructor string contains the only attributes that are specific to SAS.
If errors occur when creating a workspace, then the object manager writes entries to the Event Log.

Constructor Parameters Used to Connect with Metadata

The following parameters are required when you use a constructor string to connect to SAS with metadata:
logicalName
specifies which sasServer objects to use when creating objects in the pool.
referenceDN
specifies the login to use for authentication. This parameter is necessary only for an IOM Bridge connection. For the SAS Metadata Server, specifying only the logicalName parameter sets the value of referenceDN as the identity of the user who is specified in the metadata configuration file.
Here is an example of a valid constructor string:
logicalname=pooltest;referencedn=A5YEODSG.AE00005L

Constructor Parameters Used to Connect without Metadata

The following parameters are required when you use a constructor string to connect to SAS without metadata:
classIdentifier
specifies the class ID number. For example, 2887E7D7-4780-11D4-879F-00C04F38F0DB specifies a SAS Metadata Server. The default value is 440196D4-90F0-11D0-9F41-00A024BB830C, which specifies a SAS Workspace Server.
machineDNSName
specifies the name of the machine to connect to.
protocol
can be either com or bridge.
port
specifies the port number of a server to connect to. This parameter should be specified only for an IOM Bridge connection.
serviceName
used to resolve a TCP/IP service to a port number. This parameter should be specified only for an IOM Bridge connection. Only one of the port or serviceName parameters should be specified.
loginName
specifies the user ID to use when connecting to a SAS server. This parameter should be specified only for an IOM Bridge connection.
password
defines the password that authenticates the loginName. This parameter should be specified only for an IOM Bridge connection.