Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 URGENT - SQL TIMEOUT Error

Author  Topic 

Dhuka
Starting Member

8 Posts

Posted - 2007-04-12 : 18:05:31
Helloo Everybody

I need an urgent help plz reply back as soon as possible.

I am getting following error when i execute my ASP.net application. It is using SQL Server 2000 at back-end.

"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."

Upon searching over the internet i found that this may be caused due to connection leaks but I thorougly checked my code and didn't find any possibility for connection leakage.

Even after that I closed my application and STOPPED my sqlserver database and STARTed it once again and ran the application but the error is persistent despite of the fact that its only me who is using the application.

I am completely confused why this is happening. Can anybody please assist me in resolving this issue?????

Regard,
Zulfiqar Dhuka

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-12 : 18:10:14
Post your connection string here.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-04-12 : 18:12:03
Have you tried looking at the execution plan? Have you recently run UPDATE STATISTICS? How about DBCC DBREINEX or DBCC INDEXDEFRAG? How much memory do you have on the server? What is the execution plan for the query? ....

Can you post your query? How about the table structure and indexes for those tables involved in the query?

What is your command timeout set to? How long does the query take to execute normally?

How is this urgent if you are the only who connecting to the system?

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Dhuka
Starting Member

8 Posts

Posted - 2007-04-12 : 18:23:10
quote:
Originally posted by Peso

Post your connection string here.


Peter Larsson
Helsingborg, Sweden



Following is the function that OPENs CONNECTION

Public Shared Function ConnectToDatabase() As SqlConnection
Dim con As SqlConnection
Try
SetDBProperties()

strConnectionString = "SERVER=" + strServer.ToString + ";"
strConnectionString = strConnectionString + "User ID=" + strUserID.ToString + ";"
strConnectionString = strConnectionString + "Password=" + Trim(strPassword.ToString) + ";"
strConnectionString = strConnectionString + "Max Pool Size=10; Min Pool Size=5;"
strConnectionString = strConnectionString + "Initial Catalog=" + strDatabase.ToString

If IsNothing(con) Then
con = New SqlConnection(strConnectionString)
con.Open()
Else
If con.State.Closed Then
con.Open()
Else
con.Close()
con.Open()
End If
End If

Return con
Catch ex As Exception
con = Nothing
End Try
End Function

This is the way its being called.....

Public Function SelectAll(ByRef strError As structError) As Boolean
Try

con = clsDbCnn.ConnectToDatabase()
objDA = New MyDA(con)
'''''''''''Perform work
Return True
Catch ex As Exception
strError.strMsg = Err.Description
strError.intCode = Err.Number
Return False
Finally
clsDbCnn.DisConnectToDatabase(con)
objDA = Nothing
End Try

End Function

I hope it clarifies ur queries. It's URGENT because i am stuck with my development activity...can't go ahead until this problem is resolved.

Regards,
Zulfiqar Dhuka
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-12 : 18:27:04
http://www.webmasterworld.com/r/redirect.cgi?f=47&d=1785&url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlmag03/html/The_NETConnectionPoolLifeguard.asp

http://msdn2.microsoft.com/en-us/library/aa175863(SQL.80).aspx


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-04-12 : 18:38:47
Sigh, you didn't answer my questions.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Dhuka
Starting Member

8 Posts

Posted - 2007-04-12 : 18:49:19
quote:
Originally posted by tkizer

Sigh, you didn't answer my questions.

Tara Kizer
http://weblogs.sqlteam.com/tarad/



Well this thing is it was working fine just two days back and I haven't changed any parameter in SQL Server at all in that duration. Therefore, I think if it was working with same configuration two days back then it should work now also.

Anywayz...i did answer one of ur question "WHY ITS URGENT??"..;)

Regards
Zulfiqar Dhuka
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-04-12 : 18:59:39
Your assumption is not correct. You could have a bad execution plan for the query, fragmented indexes, low buffer cache hit ratio, and loads of other things.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Dhuka
Starting Member

8 Posts

Posted - 2007-04-12 : 19:22:36
quote:
Originally posted by tkizer

Your assumption is not correct. You could have a bad execution plan for the query, fragmented indexes, low buffer cache hit ratio, and loads of other things.

Tara Kizer
http://weblogs.sqlteam.com/tarad/



Well the thing is it doesn't reach any query at all...as the error comes right when i attempt to open connection with the database. Query hasn't come in the scene as yet...and it will only be executed once I have an established connection with the database.
Therefore I think execution plan, fragmented indexes, buffer cache are all meaningless in the context of my error.

I hope you got my point.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-04-13 : 00:45:03
Are you able to successfully connect to the SQL Server through Query Analyzer using the same credentials as in your connection string?

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-04-13 : 03:31:09
See if this helps you
http://vyaskn.tripod.com/watch_your_timeouts.htm

Also, Give us more informations when you are asked to give

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Dhuka
Starting Member

8 Posts

Posted - 2007-04-13 : 06:10:47
Sorry guys and gals....it was happening due to my own mistake.
Actually i am refering my SQL Server with IP address and a day ago i had to change my PC's IP but I forgot to change it in my application too.

Thanks for help everybody

Regards,
Zulfiqar Dhuka
Go to Top of Page
   

- Advertisement -