oracle 超时时间已过。所有池连接都在使用中并且达到了最大池大小
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7703671/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
timeout period elapsed. all pooled connections were in use and max pool size reached
提问by Harris javed
After some time the following error page is shown.
一段时间后,将显示以下错误页面。
What can I do to prevent this?
我能做些什么来防止这种情况?
I have large numbers of users and the app uses Oracle 11g. Please suggest me pool size so can be extended default max pool size is 100.
我有大量用户,该应用程序使用 Oracle 11g。请建议我池大小,以便可以扩展默认最大池大小为 100。
I have checked all connections properly closed. I am using OracleDataReader
and Datatable
in my application Method that i am using is as under:
我已经检查了所有连接是否正确关闭。我正在使用OracleDataReader
并Datatable
在我的应用程序中使用的方法如下:
public OracleDataReader BidNoIncr()
{
OracleConnection objOracleConnection = new OracleConnection(objDBClass.GetConnSring());
OracleDataReader objDataReader;
string strQuery = "Select max(BID_NO)+1 as SNumber from HH_BIDS";
OracleCommand objOracleCommand = new OracleCommand(strQuery, objOracleConnection);
objOracleConnection.Open();
objDataReader = objOracleCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
return objDataReader;
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.]
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +309609
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +125
System.Data.OracleClient.OracleConnection.Open() +43
DbClass.GetConnSring() +58 DBViewRec.ViewSalvageItems() +53
viewsalvageitems.ShowRecords() +44
viewsalvageitems.Page_Load(Object sender, EventArgs e) +5
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
超时已过。在从池中获取连接之前超时时间已过。这可能是因为所有池连接都在使用中并且达到了最大池大小。说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。
异常详细信息:System.InvalidOperationException:超时已过期。在从池中获取连接之前超时时间已过。这可能是因为所有池连接都在使用中并且达到了最大池大小。
源错误:在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常来源和位置的信息。
堆栈跟踪:
[InvalidOperationException:超时已过期。在从池中获取连接之前超时时间已过。这可能是因为所有池连接都在使用中并且达到了最大池大小。]
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +309609
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +125
System.Data.OracleClient.OracleConnection.Open() +43
DbClass.GetConnSring() +58 DBViewRec.ViewSalvageItems() +53
viewsalvageitems.ShowRecords() +44
viewsalvageitems.Page_Load(Object sender, EventArgs e) +5
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control。 OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
回答by Sergey Kudriavtsev
In general, this error may occur in the following situations:
一般来说,这个错误可能出现在以下几种情况:
1) You have a very large number of users using your database in the same time and you run out of free connections. Possible solutions: increase number of allowed connections on your server and/or (if your system is a webserver) increase the pool size specified in database connection string.
1) 您有大量用户同时使用您的数据库,并且您的免费连接已用完。可能的解决方案:增加服务器上允许的连接数和/或(如果您的系统是网络服务器)增加数据库连接字符串中指定的池大小。
2) Your system has poor database logic design and/or connection leaks like when connection open isn't closed properly later. Solution for this will be auditing your code for such connection leaks and fixing them by properly closing connections all the time.
2) 你的系统有糟糕的数据库逻辑设计和/或连接泄漏,比如以后没有正确关闭连接打开。对此的解决方案是审核您的代码是否存在此类连接泄漏,并通过始终正确关闭连接来修复它们。