Hi,
I get the following error in a volume creation program, when the program try
to open the SQL Connection.
The program executes the same code successfully a number of times before it
stops.
I have changed the Max Pool Size to 1000 but it does not make a difference.
Method : GetValidSQLConnection on thread : 2512 on Machine : WS-STEFAN2 from
the base directory : N:\Dev\XLiveCreateVolume\bin\ :
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.
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at SDTFunctions.clsSQLRead.GetValidSQLConnection(String pstrSQL) in
N:\Dev\SDTFunctions\clsSQLRead.vb:line 191 , Query : Execute
LIF_iProdValHIVOption_L_FK 2000 , ConnectionString:
UID=sa;PWD=system;SERVER=svr-snowwhite;DATABASE=xlif_d_sdt ; Max Pool
Size=1000
Can any body help me?
Private mobjSQLConnection As Data.SqlClient.SqlConnection
Public Sub GetValidSQLConnection(ByVal pstrSQL As String)
Dim lstrError As String = ""
Try
If Sys.ConnectionString.Trim.Length = 0 Then
Throw New Exception(Me.ToString & " - The property
Sys.ConnectionString cannot be empty.")
End If
If Not mobjSQLConnection Is Nothing AndAlso
(mobjSQLConnection.ConnectionString <> mobjSys.ConnectionString) Then
mobjSQLConnection.Close()
mobjSQLConnection.Dispose()
mobjSQLConnection = Nothing
End If
If mobjSQLConnection Is Nothing Then
mobjSQLConnection = New
SqlClient.SqlConnection(mobjSys.ConnectionString)
End If
If mobjSQLConnection.State = ConnectionState.Closed Then
mobjSQLConnection.ConnectionString = mobjSys.ConnectionString
mobjSQLConnection.Open()
End If
Catch er As Exception
lstrError = er.ToString & " , Query : " & pstrSQL
Try
If Not mobjSQLConnection Is Nothing Then
lstrError &= " , ConnectionString: " &
mobjSQLConnection.ConnectionString
End If
Catch ex As Exception
End Try
LogEvent(lstrError)
If ContextUtil.IsInTransaction Then ContextUtil.SetAbort()
Throw er
End Try
End Sub
Stefan Heunis
SDT Financial Software Solutions (Pty) Ltd
Mobile +27(0)82 415 5131
Tel +27(0)12-347 4945
Fax +27(0)12-347 4946
Visit us at www.sdt.co.za
The gateway to the financial services future!
The views expressed in this e-mail are, unless otherwise stated, those of the author
and not of SDT or its management. The information is confidential and is intended
solely for the addressee. All reasonable steps are taken to ensure the accuracy,
integrity and confidentiality of information. No liability or responsibility is
accepted if information is corrupted or does not reach its intended destination. This
email message has been scanned for viruses and cleared.
===================================
This list is hosted by DevelopMentor� http://www.develop.com
NEW! ASP.NET courses you may be interested in:
2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet
Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet
View archives and manage your subscription(s) at http://discuss.develop.com