mySQL disconnects

Bob Sneidar bobsneidar at iotecdigital.com
Sun Feb 2 14:30:34 EST 2014


Hi Stephen. Thanks for the reply. 

I do in fact close the connection each time. But for some reason, when I attempt to reconnect, if it has been too long a time since the last connection, I get that error. Also, I am developing on a laptop, and when I take the laptop to another location, from work to home for example it seems to happen there too.

There may be something else going on here, I am not sure. This doesn’t happen with sqLite databases (of course) only with mySQL databases, and the error does not say that I cannot connect, it says that a disconnect occurred while querying the database. 

Another factor is that I am using sqlYoga. I am not sure if Trevor is doing something behind the scenes that stores information specific to the network connection, so that is an unknown, although I don’t see why he would. This problem would also occur when I developed at my last place of employment, and the SQL server was local there, not remote as in on-rev. 

I have a small snippet of code that pings the sql server just to make sure I actually have a logical network connection in the first place, and that returns true even before the dreaded timeout. Might this be an on-rev problem? 

At any rate, I can think of multiple scenarios where a user might get disconnected from a network, and if I could reduce that timeout from one minute to something like 5 seconds or even 10 seconds, and then make sure my queried data is not too large, I could at least mitigate the problem by informing the user and allowing the user to decide if he wants to continue trying. 

Bob


On Jan 31, 2014, at 13:36 , stephen barncard <stephenREVOLUTION2 at barncard.com> wrote:

> On Fri, Jan 31, 2014 at 8:28 AM, Bob Sneidar <bobsneidar at iotecdigital.com>wrote:
> 
>> I need a way to test whether or not the current connection to the database
>> is still valid without invoking the 1 minute wait. Any suggestions?
>> 
> 
> why do you have to keep 'connected' at all?  Why not open and close the
> connection with each transaction - there is practically no overhead for
> that - what usually takes time is the transmission of data…..  or am I
> missing something?
> 
> *--*
> *Stephen Barncard - San Francisco Ca. USA - Deeds Not Words*
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list