About Store Community Documentation Contact



Post Reply 
MySQL, MSSQL problem
Author Message
Zervox Offline
Legacy License Owner

Post: #1
MySQL, MSSQL problem
I've noticed that sometimes after long session of inactive use of the SQL connection it will suddenly stop taking input through the sql commands, does the Sql class drop connection after a while and needs to use Sql.connect again? if so are there any function to detect when the link was closed so I could reconnect it?
03-16-2012 01:43 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Source Licensee

Post: #2
RE: MySQL, MSSQL problem
Hi Zervox, I've been using MSSQL as the db backend for months now, and the longest I've had the server .exe running without exe restart is over 2 weeks for one reason or another. So as far as the code goes, I don't think the code terminates connection after some period of inactivity. On the SQL server-side however, there is an AutoClose flag that you can turn on and off. It is likely that your db session is being dropped by the SQL server after inactivity.
(This post was last modified: 03-16-2012 01:50 AM by aceio76.)
03-16-2012 01:49 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Legacy License Owner

Post: #3
RE: MySQL, MSSQL problem
Seems MSSQL is the only one offering that or I might be blind, atleast the odbc driver for MySQL offers auto reconnect but the docs does not say anything in MySQL about something to disable AutoClose or anything about automatically closing connections. In fact most people seem to use mysql_thread_id() to detect the connection and then reconnect using the auto reconnect if reconnect is enabled, but seems just keeping it active is actually the recommended way.
(This post was last modified: 03-16-2012 02:40 AM by Zervox.)
03-16-2012 02:37 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Source Licensee

Post: #4
RE: MySQL, MSSQL problem
Are you using MSSQL or MySQL? Either way, in each of their respective management console, what do you see the dbserver is saying about the connection made by your app? Is it showing 'sleeping' (might be called differently) when you notice that the app has lost connection?
(This post was last modified: 03-16-2012 05:25 AM by aceio76.)
03-16-2012 05:24 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Legacy License Owner

Post: #5
RE: MySQL, MSSQL problem
MySQL, It doesn't have any connections when the calls my app is being done, which is why I say it is being dropped, it never puts the connection to sleep either even though I use connection pooling and allow for sleeping connections, however in my case it doesn't matter now, as I simply make a command call every 5th minute to make sure it is maintained active.
03-16-2012 05:50 AM
Find all posts by this user Quote this message in a reply
Post Reply