I have an application with mysql. It works fine but if I stop using it for a few minutes the mysql connection is lost (Lost connection to MySQL during query #2013).
There is no problem with the network and the server is ok.
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
mysql connection
mysql connection
No answer?
-
- Mensajes: 360
- Registrado: Mié Dic 03, 2008 5:05 am
mysql connection
#include "Xailer.ch"
//---------------------------------------------------------- --------------------
// SOPORTE CONEXION DATA SOURCE MySQL
//---------------------------------------------------------- --------------------
#define DK_DEFAULT_OR_NOT DEFAULT // Why ? :'(
CLASS TMySQLDataSource FROM XMySQLDataSource
METHOD CheckError( cArgument, nStackLevel )
METHOD Recupera( cArgument )
ENDCLASS
//---------------------------------------------------------- --------------------
METHOD CheckError( cArgument, nStackLevel ) CLASS TMySQLDataSource
LOCAL oErr, lSuccess , x:=0
IF ::nLastError != 0
IF ::nLastError==2006 // MySQL server has gone away
::Recupera(cArgument)
ELSEIF ::nLastError==2013 // MySQL server lost
::Recupera(cArgument)
ELSEIF ::nLastError==2014 // MySQL Command Out if Sync
::Recupera(cArgument)
ELSE
IF Len( cArgument ) > 4096
cArgument := Left( cArgument, 4096 ) + "..."
ENDIF
::NewError( ::cLastError, ::nLastError,, "MySQL:" + cArgument )
ENDIF
ENDIF
RETURN Nil
//---------------------------------------------------------- --------------------
METHOD Recupera( cArgument ) CLASS TMySQLDataSource
LOCAL oErr, lSuccess , x:=0
*MSGINFO(::nLastError)
IF ::nLastError!=2014 // MySQL Command Out if Sync
::Disconnect()
ENDIF
ProcessMessages(); Sleep( 10 )
Waiton('Reconectado con Servidor...')
For x:=1 to 10
lSuccess := ::Connect(); ProcessMessages(); Sleep( 10 )
if( !lSuccess )
loop
endif
NEXT
WaitOff()
if( !lSuccess )
::NewError( ::cLastError, ::nLastError,, "MySQL:" + cArgument )
endif
RETURN NIL
-
- Mensajes: 558
- Registrado: Mar Feb 09, 2010 2:26 pm
mysql connection
El 25/01/2012 15:28, Martin Del Angel escribió:
> On 1/25/2012 7:31 AM, Roberto wrote:
>> No answer?
>
> Hi Roberto:
>
> Add this prg to your Projects and recompile.
>
>
> Some Messages are in Spanish, change them to English.
>
>
> Regards.
>
> Martin Del Angel
> T&T SOFTWARE DE MEXICO SA DE CV
> www.tytsoftwaredemexico.com
Greetings:
If you use the "prg" has commanded you "Martin Del Angel", you must
add these two functions that you attached.
The functions "WaitOn" and "WaitOff" prg are included in the
"Messages" whose author is "Bingen", you can look at
http://xailer.info/esp/?p=239
José R.Castro.
--
> On 1/25/2012 7:31 AM, Roberto wrote:
>> No answer?
>
> Hi Roberto:
>
> Add this prg to your Projects and recompile.
>
>
> Some Messages are in Spanish, change them to English.
>
>
> Regards.
>
> Martin Del Angel
> T&T SOFTWARE DE MEXICO SA DE CV
> www.tytsoftwaredemexico.com
Greetings:
If you use the "prg" has commanded you "Martin Del Angel", you must
add these two functions that you attached.
The functions "WaitOn" and "WaitOff" prg are included in the
"Messages" whose author is "Bingen", you can look at
http://xailer.info/esp/?p=239
José R.Castro.
--
-
- Mensajes: 360
- Registrado: Mié Dic 03, 2008 5:05 am
mysql connection
On 1/25/2012 12:37 PM, José Ramón Castro Polinio wrote:
> El 25/01/2012 15:28, Martin Del Angel escribió:
>> On 1/25/2012 7:31 AM, Roberto wrote:
>>> No answer?
>>
>> Hi Roberto:
>>
>> Add this prg to your Projects and recompile.
>>
>>
>> Some Messages are in Spanish, change them to English.
>>
>>
>> Regards.
>>
>> Martin Del Angel
>> T&T SOFTWARE DE MEXICO SA DE CV
>> www.tytsoftwaredemexico.com
>
> Greetings:
>
> If you use the "prg" has commanded you "Martin Del Angel", you must add
> these two functions that you attached.
> The functions "WaitOn" and "WaitOff" prg are included in the "Messages"
> whose author is "Bingen", you can look at http://xailer.info/esp/?p=239
>
> José R.Castro.
Thanks José for the Additional Info.
Best Regards...
> El 25/01/2012 15:28, Martin Del Angel escribió:
>> On 1/25/2012 7:31 AM, Roberto wrote:
>>> No answer?
>>
>> Hi Roberto:
>>
>> Add this prg to your Projects and recompile.
>>
>>
>> Some Messages are in Spanish, change them to English.
>>
>>
>> Regards.
>>
>> Martin Del Angel
>> T&T SOFTWARE DE MEXICO SA DE CV
>> www.tytsoftwaredemexico.com
>
> Greetings:
>
> If you use the "prg" has commanded you "Martin Del Angel", you must add
> these two functions that you attached.
> The functions "WaitOn" and "WaitOff" prg are included in the "Messages"
> whose author is "Bingen", you can look at http://xailer.info/esp/?p=239
>
> José R.Castro.
Thanks José for the Additional Info.
Best Regards...
mysql connection
Roberto,
> I have an application with mysql. It works fine but if I
> stop using it for a few minutes the mysql connection is lost
> (Lost connection to MySQL during query #2013).
> There is no problem with the network and the server is ok.
The component TMySQLDatasource has a built-in procedure to do pings to
the server, in order to reconnect if the conection has closed due a
timeout. It's driven by the 'nTimeout' property, which is setted to 1000
seconds by default. Try to change it to a lower value, f.e. 180 (3 minutes).
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
> I have an application with mysql. It works fine but if I
> stop using it for a few minutes the mysql connection is lost
> (Lost connection to MySQL during query #2013).
> There is no problem with the network and the server is ok.
The component TMySQLDatasource has a built-in procedure to do pings to
the server, in order to reconnect if the conection has closed due a
timeout. It's driven by the 'nTimeout' property, which is setted to 1000
seconds by default. Try to change it to a lower value, f.e. 180 (3 minutes).
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info