|
-
Jun 25th, 2003, 02:54 AM
#1
Thread Starter
Lively Member
Bug with VS.Net 2003 SQL Server Debugging feature?
My app keep on throwing a :
System.InvalidOperationException
with the message:
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.
since upgrading to VS.Net 2003.
It seems that with SQL Server Debugging turned on in :
Project -> Properties -> Configuration Properties -> Debugging -> SQL Server Debugging
The connection to the SQL Server isn't closed even when I have a cn.close in my code.
When I turn off the SQL Server Debugging the connection closes properly. This is my code to recreate the error.
Dim i As Integer
For i = 1 To 1000
Dim cn As New SqlConnection
cn.ConnectionString = "Initial Catalog=MyDB;Data Source=MyPC;User ID=sa;password=;Connection Timeout=5"
cn.Open()
cn.Close()
Console.WriteLine(i & " connections opened")
Next
End Sub
With SQL Server Debugging turned on the exception is thrown every time after opening 100 connections. The exact same code runs fine when it's turned off.
Has anyone encountered this problem and is there a fix available? I really need the SQL Debugging feature in some of my projects.
-
Jun 25th, 2003, 06:29 AM
#2
Frenzied Member
Dude, why are you opening 1000 connections?
-
Jun 25th, 2003, 10:09 AM
#3
Thread Starter
Lively Member
The code here is just to test the theory. Plus I'm not opening 1000 connections.
I'm opening and closing the connections. Should have no error, but with the SQL Server Debugging on, the exception is thrown at the 100th iteration.
In my actual app the connections are opened and closed when i load a form to get user's personal preferences, that kind of stuff. So it's opened quite a lot anyway.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|