Skip to content

Implement isolation

This article describes how to isolate Client web service modules and functions to resolve issues related to thread safety.

Introduction

When a Client web service function that is not thread safe is called simultaneously from two or more clients you may experience all kinds of problems because the functions are executed in separate threads within the same process. Version 1.8.1043 of ZervicePoint offers a way of resolving such issues by introducing a new configuration option in the providers.xml file associated with the provider. The new option is called *webserviceisolation *and when used makes the module/function(s) execute in a separate application domain, eliminating the thread safety requirement for providers. The drawback is higher memory usage and decreased performance, therefore this configuration option should only be used when no other options are available.

Step-by-step guide

  1. Locate the providers.xml file used to inventory the provider.
  2. Add the following XML markup to the configuration section.

    <add key="webserviceisolation" value="[modulename]{/[functionname]}" />
    

    where modulename *is the name of the module (for example *DropDown.VMWareHost) and *functionname *is the optional name of a function to isolate. If no function name is specified, all existing functions within the specified module will be isolated.

Examples

The following example isolates all functions in a single drop-down data source.

<?xml version="1.0" encoding="utf-8"?>
<providers>
  <provider name="VMWare">
    <assembly type="Zipper.ZervicePoint.ProvisioningSystem.PowerShellProvider.PowerShellEngine" assemblyFile="C:\Program Files\Zipper\ZervicePoint\ProvisioningSystem\Providers\PowerShell\Zipper.ZervicePoint.ProvisioningSystem.PowerShellProvider.dll"/>
    <configuration>
      <add key="webserviceisolation" value="DropDown.VMWareHost" />
      <add key="scriptpath" value="C:\Program Files\Zipper\ZervicePoint\Provider Extensions\vmware\Data Sources\" />
    </configuration>
  </provider>
</providers>

The following example isolates two functions in a webservice module.

<?xml version="1.0" encoding="utf-8"?>
<providers>
  <provider name="VMWare">
    <assembly type="Zipper.ZervicePoint.ProvisioningSystem.PowerShellProvider.PowerShellEngine" assemblyFile="C:\Program Files\Zipper\ZervicePoint\ProvisioningSystem\Providers\PowerShell\Zipper.ZervicePoint.ProvisioningSystem.PowerShellProvider.dll"/>
    <configuration>
      <add key="webserviceisolation" value="WebService.VMWare/Get-ZPVMWareHostFromDatacenterId,WebService.VMWare/Get-ZPVMWareHostFromClusterId" />
      <add key="scriptpath" value="C:\Program Files\Zipper\ZervicePoint\Provider Extensions\vmware\Data Sources\" />
    </configuration>
  </provider>
</providers>

The following example isolates every function of every module (the entire provider).

<?xml version="1.0" encoding="utf-8"?>
<providers>
  <provider name="VMWare">
    <assembly type="Zipper.ZervicePoint.ProvisioningSystem.PowerShellProvider.PowerShellEngine" assemblyFile="C:\Program Files\Zipper\ZervicePoint\ProvisioningSystem\Providers\PowerShell\Zipper.ZervicePoint.ProvisioningSystem.PowerShellProvider.dll"/>
    <configuration>
      <add key="webserviceisolation" value="*" />
      <add key="scriptpath" value="C:\Program Files\Zipper\ZervicePoint\Provider Extensions\vmware\Data Sources\" />
    </configuration>
  </provider>
</providers>