0
我有一個ASHX文件下面的代碼 - 不要問爲什麼;-)OracleConnection.ClearAllPools - 操作無效由於對象的當前狀態
<%@ 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; }
}
}
}
調用時,變得異常寫出來:
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)
任何建議,什麼狀態連接池需要在嘗試清除它們之前是?
感謝,
是的,我打開它在反射器以及看到相同。不知道爲什麼我當時沒有連接池(也許應用程序在我將ashx文件放在那裏時重新啓動...) – ConsultUtah 2009-08-17 17:24:35