Ограничение соединения Sql Server 2005 - PullRequest
1 голос
/ 02 октября 2008

Существует ли ограничение на количество подключений к Sql Server 2005 Developers Edition. У нас много потоков, собирающих соединения, и я знаю, что ADO.NET выполняет пул соединений, но я получаю исключения OutOfMemory. Вынимаем соединения дб и все работает нормально.

Ответы [ 4 ]

4 голосов
/ 02 октября 2008

Ответ на этот вопрос в блоге Euan Garden (руководитель программы для Visual Studio Team Edition):

Нет ограничений по объему памяти, размеру БД или процессорам для DE, по сути это Enterprise Edition. Однако существует лицензионное ограничение, которое не позволяет использовать его в производстве.

Поэтому вам, вероятно, нужно просто убедиться, что вы правильно закрываете свои объекты подключения. Блок , использующий , идеально подойдет для такой работы ...

3 голосов
/ 02 октября 2008

Возможно, вы неправильно закрываете или утилизируете объекты подключения. Убедитесь, что ваш код выглядит примерно так:

using (SqlConnection conn = new SqlConnection("connectionstring"))
{
    conn.Open();

    // database access code goes here
}

Блок using автоматически закроет и удалит объект подключения.

2 голосов
/ 02 октября 2008

32767 в выпуске Enterprise Edition


9.00.3235.00
SP2
Enterprise Edition
3

Как я проверяю ...

CREATE FUNCTION [dbo] .svfV1GetSessionAndServerEnvironmentMetaData ВОЗВРАЩАЕТСЯ xml КАК НАЧАТЬ

-- Declare the return variable here
DECLARE @ResultVar xml

-- Add the T-SQL statements to compute the return value here
SET @ResultVar =
    (
        SELECT  
            @@SPID                                          as  SPID,
            @@ProcID                                        as  ProcId,
            @@DBTS                                          as  DBTS,
            getdate()                                       as  DateTimeStamp,
            System_User                                     as  SystemUser,
            Current_User                                    as  CurrentUser,
            Session_User                                    as  SessionUser,
            User_Name()                                     as  UserName,
            Permissions()                                   as  UserSessionPermissionsBitmap,
            Host_Id()                                       as  HostId,
            Host_Name()                                     as  HostName,
            App_Name()                                      as  AppName,

            ServerProperty('ProcessId')                     as  ServerProcessId,
            ServerProperty('MachineName')                   as  ServerMachineName,
            ServerProperty('ServerName')                    as  ServerServerName,
            ServerProperty('ComputerNamePhysicalNetBIOS')   as  ServerComputerNamePhysicalNetBIOS,
            ServerProperty('InstanceName')                  as  ServerInstanceName,
            ServerProperty('ProductVersion')                as  ServerProductVersion,
            ServerProperty('ProductLevel')                  as  ServerProductLevel,

            @@CONNECTIONS                                   as  CumulativeSqlConnectionsSinceStartup,
            @@TOTAL_ERRORS                                  as  CumulativeDiskWriteErrorsSinceStartup,
            @@PACKET_ERRORS                                 as  CumulativeNetworkPacketErrorsSinceStartup,

            --Note:  
            --If the time returned in @@CPU_BUSY, or @@IO_BUSY exceeds approximately 49 days of cumulative CPU time, 
            --you receive an arithmetic overflow warning. In that case, 
            --the value of @@CPU_BUSY, @@IO_BUSY and @@IDLE variables are not accurate. 
        --  @@CPU_BUSY * @@TIMETICKS                        as  CumulativeMicroSecondsServerCpuBusyTimeSinceStartup,
        --  @@IO_BUSY * @@TIMETICKS                         as  CumulativeMicroSecondsServerIoBusyTimeSinceStartup,
        --  @@IDLE * @@TIMETICKS                            as  CumulativeMicroSecondsServerIdleTimeSinceStartup,

            ServerProperty('BuildClrVersion')               as  ServerBuildClrVersion,
            ServerProperty('Collation')                     as  ServerCollation,
            ServerProperty('CollationID')                   as  ServerCollationId,
            ServerProperty('ComparisonStyle')               as  ServerComparisonStyle,
            ServerProperty('Edition')                       as  ServerEdition,
            ServerProperty('EditionID')                     as  ServerEditionID,
            ServerProperty('EngineEdition')                 as  ServerEngineEdition,
            ServerProperty('IsClustered')                   as  ServerIsClustered,
            ServerProperty('IsFullTextInstalled')           as  ServerIsFullTextInstalled,
            ServerProperty('IsIntegratedSecurityOnly')      as  ServerIsIntegratedSecurityOnly,
            ServerProperty('IsSingleUser')                  as  ServerIsSingleUser,
            ServerProperty('LCID')                          as  ServerLCID,
            ServerProperty('LicenseType')                   as  ServerLicenseType,
            ServerProperty('NumLicenses')                   as  ServerNumLicenses,
            ServerProperty('ResourceLastUpdateDateTime')    as  ServerResourceLastUpdateDateTime,
            ServerProperty('ResourceVersion')               as  ServerResourceVersion,
            ServerProperty('SqlCharSet')                    as  ServerSqlCharSet,
            ServerProperty('SqlCharSetName')                as  ServerSqlCharSetName,
            ServerProperty('SqlSortOrder')                  as  ServerSqlSortOrder,
            ServerProperty('SqlSortOrderName')              as  ServerSqlSortOrderName,

            @@MAX_CONNECTIONS                               as  MaxAllowedConcurrentSqlConnections,

            SessionProperty('ANSI_NULLS')                   as  SessionANSI_NULLS,
            SessionProperty('ANSI_PADDING')                 as  SessionANSI_PADDING,
            SessionProperty('ANSI_WARNINGS')                as  SessionANSI_WARNINGS,
            SessionProperty('ARITHABORT')                   as  SessionARITHABORT,
            SessionProperty('CONCAT_NULL_YIELDS_NULL')      as  SessionCONCAT_NULL_YIELDS_NULL,
            SessionProperty('NUMERIC_ROUNDABORT')           as  SessionNUMERIC_ROUNDABORT,
            SessionProperty('QUOTED_IDENTIFIER')            as  SessionQUOTED_IDENTIFIER
        FOR XML PATH('SequenceIdEnvironment')
    )   
-- Return the result of the function

RETURN @ ResultVar

END

в моем экземпляре ядра СУБД SQL Server возвращает

1024 *
*
56
1666821000
AAAAAAAAB9A =
2008-10-02T15: 09: 26.560 ...
dbo
дБо
dbo
67044350
3852 ...
Microsoft SQL Server Management Studio - запрос
508 ...
9.00.3235.00
SP2
169394
0
0
v2.0.50727
SQL_Latin1_General_CP1_CI_AS
872468488
196609
Enterprise Edition ...
3
0
1
0
0 ...
2008-03-12T18: 59: 08,633
9.00.3235
1
iso_1
52
nocase_iso **
32767 **
1 </ SessionANSI_NULLS>
1 </ SessionANSI_PADDING>
1 </ SessionANSI_WARNINGS>
1
1 </ SessionCONCAT_NULL_YIELDS_NULL>
0 </ SessionNUMERIC_ROUNDABORT>
1 </ SessionQUOTED_IDENTIFIER>

0 голосов
/ 02 октября 2008

Исключения нехватки памяти в .NET? Если бы ошибка была на сервере, вы, вероятно, вместо этого увидели бы сообщение об отказе в соединении.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...