Using the Persist Connection Parameter

The Persist Connection parameter is available for your defined adapter component in the iSM Administration Console, as shown in the following image.

For more information on how to access this parameter, see Configuring the Adapter in an iWay Environment.

In a .NET developer project, an external datasource object is usually created and embedded inside the Assembly, with an automatic initializer. This is not possible through the iWay Technology Adapter for .NET as the sequence of calls is different. If your Assembly contains the static method getconnectionstring, then it can be used to retrieve the connection string and pass the string to a callable object.

if the method initializes a connection object, and the Persist Connection parameter is enabled, calling the method again may generate an error indicating that the connection already exists. If the object cannot be changed, then disable the Persist Connection parameter to resolve this issue.

If you are using a connection pool, consider using a session with the Persist Connection parameter enabled and also using a constructor and cache. The connection will stay initialized throughout the session. If the Persist Connection parameter is disabled, then the connection will have to be initialized for each call.

The receiver of a method call is responsible for processing the method call. If the object has not or cannot be initialized, then calling a method without a valid receiver will result in an exception indicating the following:

object not set to an instance of an object

A web service object is not a persisted object. This is the reason cache is not supported on these objects. When an adapter is passivated and retired, all connections are released, so the cache is retired. Only valid instance targets, such as process flow adapter objects can be cached.

Calling the Windows registry when executing from iWay in Service mode is governed by the rules of .NET registry retrieval and Windows security settings. This usually means that only results from HKEY_LOCAL_MACHINE can be used and the rights from the Local Administrator role. For more information, see the topic on C# and the registry in the Microsoft Developer Network (MSDN):

http://msdn.microsoft.com

Using .NET configuration files from .NET Assemblies is not supported by .NET. Calling the Configuration Manager classes retrieves results from executables only. If there is a requirement to store properties externally, then read and write the properties to an external file from the Assembly method or pass the parameters to the method at invocation time.


iWay Software