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)
 SQL Connection dropped when idle.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-03 : 10:02:54
SQLNewbie writes "Guys can u help me on this one? Ok here's the scenario, I developed a program using VB and SQL 7. My problem is that when I run the program and leave it idle for let say half an hour, different error messages appear like 'General Network Failure', 'Timeout Expired', and 'Connection Failed'. Please help me solve the problem.

Thanks"

jackstow
Posting Yak Master

160 Posts

Posted - 2002-04-03 : 10:15:46
Are you closing all your db connections in the code? Possibly they are staying open and you're using up the connection pool.. When you say you leave it idle for half an hour is the program doing anything during that time or is it just sitting there? I presume the program runs ok at first...

Go to Top of Page

emil
Starting Member

2 Posts

Posted - 2002-04-03 : 21:16:21
The program is actually a POS and Inventory and yes i do close all my DB connections in the code but only when the user terminate/end the program. The program has to be open all day even if it is not doing anything. The system runs ok at first and by the time you leave it idle for a while thats the time the error comes out. How/Where do i configure the connection pool?

Go to Top of Page

jackstow
Posting Yak Master

160 Posts

Posted - 2002-04-04 : 03:55:43
Well, here's a couple of articles I came across about VB and connection pooling;

http://www.lockwoodtech.com/index.asp?PageId=Art_connection_pooling_VBASP_I&TitleID=Top_Articles

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmdac/html/pooling2.asp

..might help. But if that is your problem I would suggest tweaking the code rather than the connection pool.

Go to Top of Page

emil
Starting Member

2 Posts

Posted - 2002-04-05 : 21:57:08
I opened the ODBC Data Source Administrator...went to the Connection pooling tab....locate the SQL Server driver....clicked on the "Don't pool connections on this driver". Did I made the right option or should I choose the other option which is "Pool connection to this driver"? If I choose the last option what value should I put on the "Time that unused connections remain in the pool in seconds"?

Go to Top of Page

jackstow
Posting Yak Master

160 Posts

Posted - 2002-04-09 : 04:07:24
As I understand it connection pooling is a good thing to use and you should use it. It means ADO won't have to make a new connection every time it is requested - it can simply take one from the pool. Regarding the time unused connections should be left in the pool I think 30 seconds is the usual default value. However, if running out of pooled connections is your problem (it could always be something else!) it's only going to get worse when you go into production. I don't have any experience of POS applications but it seems strange that the connection is just left open all the time. Wouldn't it be better to open a connection, run the code and then close the connection each time a user requests something as you would on a website...

Go to Top of Page
   

- Advertisement -