Quick Reference for ADO.NET Connection Classes
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:
- ActiveConnectionCount()
-
int count = IRISPoolManager.ActiveConnectionCount();Total number of established connections in all pools. Count includes both idle and in-use connections.
- IdleCount()
-
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.
- InUseCount()
-
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.
- RecycleAllConnections()
-
IRISPoolManager.RecycleAllConnections(bool remove);Recycles connections in all pools
IRISPoolManager.RecycleConnections(conn,bool remove)Recycles connections in the pool associated with connection object conn.
- RemoveAllIdleConnections()
-
IRISPoolManager.RemoveAllIdleConnections();Removes idle connections from all connection pools.
- RemoveAllPoolConnections()
-
IRISPoolManager.RemoveAllPoolConnections();Deletes all connections and removes all pools, regardless of what state the connections are in.
Class IRISConnection
- ClearPool()
-
IRISConnection.ClearPool(conn);Clears the connection pool associated with connection conn.
- ClearAllPools()
-
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”).
- server
-
alternate names: ADDR, ADDRESS, DATA SOURCE, DATASOURCE, HOST, NETWORK ADDRESS, NETWORKADDRESS
IP address or host name. For example: Server = localhost
- port
-
Specifies the TCP/IP port number for the connection. For example: Port = 1972
- namespace
-
alternate names: DATABASE, INITIAL CATALOG
Specifies the namespace to connect to. For example: Namespace = USER
- password
-
alternate name: PWD
User's password. Optional if accesstoken is specified. For example: Password = SYS
- user id
-
alternate names: USERID, UID, USER, USERNAME, USR
User's login name. Optional if accesstoken is specified. For example: User ID = _SYSTEM
- accesstoken
-
alternate name: access_token
An OAuth 2.0 access token. Optional if both user and password are specified. This property is incompatible with pooling. For example: accesstoken = eyJraWQiOiJzMTZ0cVNtODhw
Connection Pooling Parameters
The following parameters define various aspects of connection pooling (see “Connection Pooling”).
- connection lifetime
-
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.
- connection reset
-
alternate name: CONNECTIONRESET
Turn on Pooled connection reset mechanism (used with CONNECTION LIFETIME). Default is false.
- max pool size
-
alternate name: MAXPOOLSIZE
Maximum size of connection pool for this specific connection string. Default is 100.
- min pool size
-
alternate name: MINPOOLSIZE
Minimum or initial size of the connection pool, for this specific connection string. Default is 0.
- pooling
-
Enables connection pooling. This property is incompatible with accesstoken. Default is true.
Other Connection Parameters
The following optional parameters can be set if required.
- application name
-
Sets the application name.
- connection timeout
-
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.
- current language
-
Sets the language for this process.
- logfile
-
Turns on logging and sets the log file location.
- packet size
-
Sets the TCP Packet size. Default is 1024.
- PREPARSE CACHE SIZE
-
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.
- so rcvbuf
-
Sets the TCP receive buffer size. Default is 0 (use system default value).
- so sndbuf
-
Sets the TCP send buffer size. Default is 0 (use system default value).
- ssl
-
Specifies whether SSL/TLS secures the client-server connection (see Configuring .NET Clients to Use SSL/TLS with InterSystems IRIS). Default is false.
- tcp nodelay
-
Sets the TCP nodelay option. Default is true.
- transaction isolation level
-
Sets the System.Data.IsolationLevel value for the connection.
- workstation id
-
Sets the Workstation name for process identification.