We have a form that multiple users from multiple locations are filling out. We're having an issue where connections done to the SQL Server are not being dropped. These connections are made whenever a form is loaded to generate the lookups and fill in some of the fields. Is there a way to change the default timeout of this connection or to make it drop the connection automatically when the form is submitted?
Question
Question
How can we change the default timeout of connections done from Forms to the SQL Server for lookups?
Replies
Hi Edgar -
If you are using connection strings, the timeout is a parameter you can set like this:
Data Source=MyServer;Initial Catalog=MyDB;Integrated Security=SSPI;Connection Timeout=30;
I also like to add the application name parameter: Application Name=LF_Forms;
So you can trace things at SQL Server more easily if you need to.
Update: Sorry I see that you actually have a different issue. You WANT to force a timeout of the connection. The ConnectionTimeout parameter just reponds to the calling application if there is no response from SQL Server. Xiuhong's answer fits your situation more closely.
Hi Edgar,
How did you check that the connection is not dropped? I checked opening same form that has lookup rule both for table and stored procedure using multiple users at the same time, there is only one connection in the database when using following query:
SELECT DB_NAME(dbid) as DBName, COUNT(dbid) as NumberOfConnections, loginame as LoginName FROM sys.sysprocesses WHERE dbid > 0 GROUP BY dbid, loginame ;
And the connection will be dropped automatically after wait for some minutes.
So can you tell us more how did you run into this issue?