Configuration file example

The following example illustrates a configuration file for connection pooling. This configuration file is named either app.config or web.config.

<?xml version="1.0" encoding="utf-8" ?>
- <configuration> 
	- <UO.NET> 
		- <General> 
			<add key="SocketTimeOut" value="300000" /> 
		</General> 
	- <ConnectionPooling>
	<add key="ConnectionPoolingOn" value="1" />
	<add key="MinimumPoolSize" value="1" />
	<add key="MaximumPoolSize" value="16" />
	<add key="IdleRemoveThreshold" value="300000" />
	<add key="IdleRemoveExecInterval" value="6000" />
	<add key="OpenSessionTimeout" value="30000" /> 
		</ConnectionPooling> 
	- <PerformanceMonitor>
	<add key="BusyConnectionCounter" value="0" /> 
		</PerformanceMonitor> 
	</UO.NET> 
	- 
-<system.diagnostics> 
	+ <switches> 
	- <trace autoflush="true" indentsize="4"> 
		- <listeners> 
	 <add name="myListener" 
		type="System.Diagnostics.TextWriterTraceListener" 
		initializeData="c:\temp\myListener.log" /> 
			</listeners> 
		</trace> 
	</system.diagnostics> 
</configuration>
The following table describes the configuration parameters for connection pooling:
Parameter Description
ConnectionPoolingOn When this value is set to 1, the connection is drawn from the appropriate pool, or, if necessary, created and added to the appropriate pool. The default value is 0.
MinimumPoolSize The minimum number of connections maintained in the connection pool.
MaximumPoolSize The maximum number of connections in the connection pool.
IdleRemoveThreshold Determines the amount of time, in milliseconds, one session can remain idle in the connection pool.
IdleRemoveExecInterval The thread execution interval time, in milliseconds. During this interval, UniObjects for .NET removes idle sessions in the connection pool.
OpenSessionTimeOut How much time UniObjects for .NET waits before timing out to get a session from the connection pool. Expressed in milliseconds.