Quick Reference for the .NET Managed Provider
This chapter is a quick reference for the following extended classes and options:
-
Class IRISPoolManager — methods related to InterSystems connection pooling.
-
Class IRISConnection — methods for clearing connection pools.
-
Connection Parameter Options — lists all supported connection parameters.
Class IRISPoolManager
The IRISClient.IRISPoolManager class can be used to monitor and control connection pooling programmatically. The following static methods are available:
int count = IRISPoolManager.ActiveConnectionCount();
Total number of established connections in all pools. Count includes both idle and in-use connections.
int count = IRISPoolManager.IdleCount();
Total number of idle connections in all the pools.
int count = IRISPoolManager.IdleCount(conn);
Total number of idle connections in the pool associated with connection object conn.
int count = IRISPoolManager.InUseCount();
Total number of in-use connections in all pools.
int count = IRISPoolManager.InUseCount(conn);
Total number of in-use connections in the pool associated with connection object conn.
IRISPoolManager.RecycleAllConnections(bool remove);
Recycles connections in all pools
IRISPoolManager.RecycleConnections(conn,bool remove)
Recycles connections in the pool associated with connection object conn.
IRISPoolManager.RemoveAllIdleConnections();
Removes idle connections from all connection pools.
IRISPoolManager.RemoveAllPoolConnections();
Deletes all connections and removes all pools, regardless of what state the connections are in.
Class IRISConnection
IRISConnection.ClearPool(conn);
Clears the connection pool associated with connection conn.
IRISConnection.ClearAllPools();
Removes all connections in the connection pools and clears the pools.
Connection Parameter Options
The following tables describe all parameters that can be used in a connection string.
Required Parameters
The following parameters are required for all connection strings (see “Creating a Connection”).
alternate names: ADDR, ADDRESS, DATA SOURCE, DATASOURCE, HOST, NETWORK ADDRESS, NETWORKADDRESS
IP address or host name. For example: Server = localhost
Specifies the TCP/IP port number for the connection. For example: Port = 51774
alternate names: DATABASE, INITIAL CATALOG
Specifies the namespace to connect to. For example: Namespace = USER
alternate name: PWD
User's password. For example: Password = SYS
alternate names: USERID, UID, USER, USERNAME, USR
Set user login name. For example: User ID = _SYSTEM
Connection Pooling Parameters
The following parameters define various aspects of connection pooling (see “Connection Pooling”).
alternate name: CONNECTIONLIFETIME
The length of time in seconds to wait before resetting an idle Pooled connection when the connection reset mechanism is on. Default is 0.
alternate name: CONNECTIONRESET
Turn on Pooled connection reset mechanism (used with CONNECTION LIFETIME). Default is false.
alternate name: MAXPOOLSIZE
Maximum size of connection pool for this specific connection string. Default is 100.
alternate name: MINPOOLSIZE
Minimum or initial size of the connection pool, for this specific connection string. Default is 0.
Turn on connection pooling. Default is true.
Other Connection Parameters
The following optional parameters can be set if required.
Sets the application name.
alternate name: CONNECT TIMEOUT
Sets the length of time in seconds to try and establish a connection before failure. Default is 30. This setting will be ignored if it is greater than the default maximum defined by your OS. The OS-specific value is usually around 20 to 40 seconds.
Sets the language for this process.
Turns on logging and sets the log file location.
Sets the TCP Packet size. Default is 1024.
Sets an upper limit to the number of SQL commands that will be held in the preparse cache before recycling is applied. Default is 200.
Sets the TCP receive buffer size. Default is 0 (use system default value).
Sets the TCP send buffer size. Default is 0 (use system default value).
Specifies whether SSL/TLS secures the client-server connection (see Configuring .NET Clients to Use SSL/TLS with InterSystems IRIS). Default is false.
Sets the TCP nodelay option. Default is true.
Sets the System.Data.IsolationLevel value for the connection.
Sets the Workstation name for process identification.