ClearAllPools
このメソッドでは、すべての接続プールからすべての接続がクリアされます。
宣言
// C# public static void ClearAllPools();
備考
これは、アプリケーション用に作成されたすべての接続プールに対して、ClearPoolを呼び出す操作に似ています。
例外
InvalidOperationException - アプリケーション用の接続プールが見つかりません。
例
// C#
// Sample demonstrating the use of ClearAllPools API in OracleConnection class
using System;
using Oracle.DataAccess.Client;
class ClearAllPoolsSample
{
static void Main()
{
Console.WriteLine("Running ClearAllPools sample..." );
// Set the connection string
string strConn = "User Id=scott;Password=tiger;Data Source=oracle;" +
"Min pool size=5;";
OracleConnection conn = new OracleConnection(strConn);
// Create another connection object with a different connection string
string strConnNew = "User Id=scott;Password=tiger;Data Source=oracle;";
OracleConnection connNew = new OracleConnection(strConnNew);
// Open the connections. Separate pools are created for conn and connNew
conn.Open();
connNew.Open();
// Clears the pools associated with conn and connNew
OracleConnection.ClearAllPools ();
// cleanup
conn.Close();
connNew.Close();
Console.WriteLine("Done!");
}
}