Sent by Randy Byers on 04/20/2010 03:16:51 PM:
All of our foxweb scripts use a back-end MS-SQL database for data storage.
Typical usage looks like this:
m_handle = SQLCONNECT(t_db,t_u,t_pw)
m_query = 'select field-list from tablename'
** do stuff with data in cursor
We have a busy environment with many users and hundreds of different scripts (and multiple foxweb servers).
Our issue is that over time, we see a gradual growth in the number of "open" connections to the MS-SQL server from our foxweb server(s). The majority of these connections are in a "sleeping" state (according to MS-SQL).
The Foxweb option named "Close Tables" is enabled.
The issue is that once the number of "open/sleeping" connections to MS-SQL increases to 200 or more, we start to have stability issues with our Foxweb server(s).
I'm wondering if there are other Foxpro commands I can run in an attempt to "clean up" open/stale/sleeping connections which are left over by my scripts.
For example, can I safely call "close databases [all]" ?
Can I safely call "close tables [all]" ?
Do you know if there is anything else I can do to close/kill connections to the MS-SQL server from within Foxpro?