I have the following code in an ashx file - don't ask why ;-)
<%@ WebHandler Language="C#" Class="Site.Pool" %>
using System;
using System.Data;
using System.IO;
using System.Web;
using System.Web.SessionState;
using Core.Database;
using Core.ITables;
using Online.Server.Busi;
using Online.Server.ITables;
using XactNet.Busi;
namespace Site
{
public class Pool : IHttpHandler, IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
try
{
Oracle.DataAccess.Client.OracleConnection.ClearAllPools();
context.Response.Write("SUCCESS");
}
catch (Exception e)
{
context.Response.Write(e.ToString());
}
}
public bool IsReusable
{
get { return false; }
}
}
}
When called, the exception gets written out:
System.InvalidOperationException: Operation is not valid due to the current state of the object.
at Oracle.DataAccess.Client.OracleConnection.ClearAllPools()
at Site.Pool.ProcessRequest(HttpContext context)
Any suggestions as to what state the connection pools need to be in before trying to clear them?
Thanks,