• ADO.NET 数据库连接池大小


    连接串不同则创建不同的池子,Max Pool Size=200;Min Pool Size=5 相同连接串的最大最小值,不同连接串则分别有自己的最大最小值。

    Max Pool Size默认100,Min Pool Size默认0。

    https://msdn.microsoft.com/zh-cn/library/8xx3tyca(v=vs.80).aspx

    https://msdn.microsoft.com/zh-cn/library/system.data.sqlclient.sqlconnection.connectionstring(VS.80).aspx

    池的创建和分配

    在初次打开连接时,将根据完全匹配算法创建连接池,该算法将池与连接中的连接字符串关联。每个连接池与不同的连接字符串关联。打开新连接时,如果连接字符串并非与现有池完全匹配,将创建一个新池。按进程、按应用程序域、按连接字符串以及(在使用集成的安全性时)按 Windows 标识来建立池连接。

    Timeout 时间已到。在操作完成之前超时时间已过或服务器未响应。

    Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

     http://www.dotnetspark.com/links/18280-timeout-when-calling-sqldataadapterfilldataset.aspx

    http://stackoverflow.com/questions/14993309/what-is-snireadsyncoverasync-and-why-would-it-take-a-long-time-to-complete

    System.Data.SqlClient.SqlException (0x80131904): Timeout expired.
    The timeout period elapsed prior to completion of the operation or the server is not responding.
    ---> System.ComponentModel.Win32Exception (0x80004005): 等待的操作过时。
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
    at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
    at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
    at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
    at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
    at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)
    at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
    at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
    at System.Data.SqlClient.SqlDataReader.get_MetaData()
    at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
    at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
    at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
    at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
    at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
    at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
    at DNA.OpenPlatform.Common.SqlHelper.ExecuteDataset(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)

  • 相关阅读:
    Linux内核分析— —操作系统是如何工作的(20135213林涵锦)
    【BARTS计划】【Share_Week1】社交产品思考
    【BARTS计划】【Tips_Week1】20190331更新
    【BARTS计划】【Review_Week1】Google Docs 成为青少年们喜爱的聊天 app
    【学习博客】Python学习初体验
    《构建之法》读书笔记5
    《构建之法》8&16
    《构建之法》读书笔记4
    《构建之法》读书笔记3
    《构建之法》读书笔记2
  • 原文地址:https://www.cnblogs.com/cn-chenhao/p/5069299.html
Copyright © 2020-2023  润新知