This is a multi-part message in MIME format.

------=_NextPart_000_0006_01C6BFE4.B675A5D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi All,

I am creating a connection to MySQL with the code below and using it in =
my CursorAdapter classes.
lnConnectionHandle =3D SQLSTRINGCONNECT(lcConnectionString,.T.)

Testing the application, I noticed that if I left one of my forms open =
without any user activity for some period of time the connection gets =
lost.

What am I missing here?

--=20
Edhy

------=_NextPart_000_0006_01C6BFE4.B675A5D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi All,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I am creating a connection to MySQL =
with the code=20
below and using it in my CursorAdapter classes.</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>
<P>lnConnectionHandle =3D </FONT><FONT face=3D"Courier New" =
color=3D#0000ff=20
size=3D2>SQLSTRINGCONNECT</FONT><FONT face=3D"Courier New"=20
size=3D2>(lcConnectionString,.T.)</P></FONT></DIV><FONT face=3DArial =
size=3D2>
<DIV>Testing the application, I noticed that if I left one of my forms =
open=20
without any user activity for some period of time the connection gets=20
lost.</DIV>
<DIV>&nbsp;</DIV>
<DIV>What am I missing here?</DIV>
<DIV><BR>-- <BR>Edhy</DIV>
<DIV></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0006_01C6BFE4.B675A5D0--

Re: Connection Handle Disconnect? by Gregory

Gregory
Tue Aug 15 09:08:18 CDT 2006


"Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
news:uDkUcYAwGHA.1512@TK2MSFTNGP04.phx.gbl...
Hi All,

I am creating a connection to MySQL with the code below and using it in my
CursorAdapter classes.
lnConnectionHandle = SQLSTRINGCONNECT(lcConnectionString,.T.)

Testing the application, I noticed that if I left one of my forms open
without any user activity for some period of time the connection gets lost.

What am I missing here?

--
Edhy
_____________________
Edhy,

Have you tried this ?

print it first: ? sqlgetprop(lnConnectionHandle, 'IdleTimeout')


=sqlsetprop(lnConnectionHandle , 'IdleTimeout', 0)

Gregory
_


Re: Connection Handle Disconnect? by Edhy

Edhy
Tue Aug 15 10:34:52 CDT 2006

Hi Gregory,

? sqlgetprop(_SCREEN.oApp.nConnectionHandle, 'IdleTimeout')

Returned 0

I will also try with "ConnectTimeOut"



Thanks for the info.

--
Edhy Rijo
www.progytech.com
Bronx NY


"Gregory Adam" <GregoryAdam@PleaseReplyViaNewsGroup.com> wrote in message
news:OPRsGRHwGHA.2232@TK2MSFTNGP05.phx.gbl...
>
> "Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
> news:uDkUcYAwGHA.1512@TK2MSFTNGP04.phx.gbl...
> Hi All,
>
> I am creating a connection to MySQL with the code below and using it in my
> CursorAdapter classes.
> lnConnectionHandle = SQLSTRINGCONNECT(lcConnectionString,.T.)
>
> Testing the application, I noticed that if I left one of my forms open
> without any user activity for some period of time the connection gets
> lost.
>
> What am I missing here?
>
> --
> Edhy
> _____________________
> Edhy,
>
> Have you tried this ?
>
> print it first: ? sqlgetprop(lnConnectionHandle, 'IdleTimeout')
>
>
> =sqlsetprop(lnConnectionHandle , 'IdleTimeout', 0)
>
> Gregory
> _



Re: Connection Handle Disconnect? by Bernhard

Bernhard
Tue Aug 15 10:39:33 CDT 2006

Hi Edhy,

> I am creating a connection to MySQL with the code below and using it in my CursorAdapter classes.
> lnConnectionHandle = SQLSTRINGCONNECT(lcConnectionString,.T.)
>
> Testing the application, I noticed that if I left one of my forms open without any user activity for some period of time the connection gets lost.
>
> What am I missing here?
Besides of some SQLSetProp settings in Foxpro, which are merely settings at
client side, there may be some settings at the server side.

Regards
Bernhard Sander

Re: Connection Handle Disconnect? by Edhy

Edhy
Tue Aug 15 10:43:02 CDT 2006

Hi Bernhard,

Thanks for the info, I am re-testing with the SQLSetPro right now, if that
does not work I will check MySQL server properties.

--
Edhy Rijo
www.progytech.com
Bronx NY


"Bernhard Sander" <fuchs@no.spam> wrote in message
news:%23l69CEIwGHA.4216@TK2MSFTNGP06.phx.gbl...
> Hi Edhy,
>
>> I am creating a connection to MySQL with the code below and using it in
>> my CursorAdapter classes.
>> lnConnectionHandle = SQLSTRINGCONNECT(lcConnectionString,.T.)
>>
>> Testing the application, I noticed that if I left one of my forms open
>> without any user activity for some period of time the connection gets
>> lost.
>>
>> What am I missing here?
> Besides of some SQLSetProp settings in Foxpro, which are merely settings
> at client side, there may be some settings at the server side.
>
> Regards
> Bernhard Sander



Re: Connection Handle Disconnect? by Edhy

Edhy
Wed Aug 16 15:45:29 CDT 2006

Well an update!

I re-installed MySQL server on another server and downloaded the data to
that server and did the same test, from my computer connected to that
database using DNSless and the same problem, after 10-15 minutes of
inactivity I could not open any other form until VFP crashed and had to
close and open it again. I have done the same test with MySQL Server on my
computer (localhost) and here I don't see no disconnection.

Any other suggestions I may try here?

--
Edhy Rijo
www.progytech.com
Bronx NY


"Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
news:ehl6iFIwGHA.1272@TK2MSFTNGP05.phx.gbl...
> Hi Bernhard,
>
> Thanks for the info, I am re-testing with the SQLSetPro right now, if that
> does not work I will check MySQL server properties.
>
> --
> Edhy Rijo
> www.progytech.com
> Bronx NY
>
>
> "Bernhard Sander" <fuchs@no.spam> wrote in message
> news:%23l69CEIwGHA.4216@TK2MSFTNGP06.phx.gbl...
>> Hi Edhy,
>>
>>> I am creating a connection to MySQL with the code below and using it in
>>> my CursorAdapter classes.
>>> lnConnectionHandle = SQLSTRINGCONNECT(lcConnectionString,.T.)
>>>
>>> Testing the application, I noticed that if I left one of my forms open
>>> without any user activity for some period of time the connection gets
>>> lost.
>>>
>>> What am I missing here?
>> Besides of some SQLSetProp settings in Foxpro, which are merely settings
>> at client side, there may be some settings at the server side.
>>
>> Regards
>> Bernhard Sander
>
>



Re: Connection Handle Disconnect? by Gregory

Gregory
Thu Aug 17 01:37:53 CDT 2006

Edhy,

Instead of _SCREEN.oApp.nConnectionHandle I would add a class to
_SCREEN.oApp that connects/reconnects/... when its connectionhandle is
accessed

Something like _SCREEN.oApp.ConnectionSql.Handle

Create the object and add it to _screen.oApp

define class ConnectionSql as ...
Handle = 0

function Handle_Access()
&& test and connect/reconnect if needed

return m.this.Handle
endfunc

enddefine

Gregory
____
"Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
news:eMp0MTXwGHA.4200@TK2MSFTNGP04.phx.gbl...
> Well an update!
>
> I re-installed MySQL server on another server and downloaded the data to
> that server and did the same test, from my computer connected to that
> database using DNSless and the same problem, after 10-15 minutes of
> inactivity I could not open any other form until VFP crashed and had to
> close and open it again. I have done the same test with MySQL Server on
> my computer (localhost) and here I don't see no disconnection.
>
> Any other suggestions I may try here?
>
> --
> Edhy Rijo
> www.progytech.com
> Bronx NY
>
>
> "Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
> news:ehl6iFIwGHA.1272@TK2MSFTNGP05.phx.gbl...
>> Hi Bernhard,
>>
>> Thanks for the info, I am re-testing with the SQLSetPro right now, if
>> that does not work I will check MySQL server properties.
>>
>> --
>> Edhy Rijo
>> www.progytech.com
>> Bronx NY
>>
>>
>> "Bernhard Sander" <fuchs@no.spam> wrote in message
>> news:%23l69CEIwGHA.4216@TK2MSFTNGP06.phx.gbl...
>>> Hi Edhy,
>>>
>>>> I am creating a connection to MySQL with the code below and using it in
>>>> my CursorAdapter classes.
>>>> lnConnectionHandle = SQLSTRINGCONNECT(lcConnectionString,.T.)
>>>>
>>>> Testing the application, I noticed that if I left one of my forms open
>>>> without any user activity for some period of time the connection gets
>>>> lost.
>>>>
>>>> What am I missing here?
>>> Besides of some SQLSetProp settings in Foxpro, which are merely settings
>>> at client side, there may be some settings at the server side.
>>>
>>> Regards
>>> Bernhard Sander
>>
>>
>
>


Re: Connection Handle Disconnect? by Edhy

Edhy
Thu Aug 17 09:51:29 CDT 2006

Hi Gregory,

Good idea, will implement it and test.

Thanks!

--
Edhy Rijo
www.progytech.com
Bronx NY


"Gregory Adam" <GregoryAdam@PleaseReplyViaNewsGroup.com> wrote in message
news:eSn2wecwGHA.4460@TK2MSFTNGP04.phx.gbl...
> Edhy,
>
> Instead of _SCREEN.oApp.nConnectionHandle I would add a class to
> _SCREEN.oApp that connects/reconnects/... when its connectionhandle is
> accessed
>
> Something like _SCREEN.oApp.ConnectionSql.Handle
>
> Create the object and add it to _screen.oApp
>
> define class ConnectionSql as ...
> Handle = 0
>
> function Handle_Access()
> && test and connect/reconnect if needed
>
> return m.this.Handle
> endfunc
>
> enddefine
>
> Gregory
> ____
> "Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
> news:eMp0MTXwGHA.4200@TK2MSFTNGP04.phx.gbl...
>> Well an update!
>>
>> I re-installed MySQL server on another server and downloaded the data to
>> that server and did the same test, from my computer connected to that
>> database using DNSless and the same problem, after 10-15 minutes of
>> inactivity I could not open any other form until VFP crashed and had to
>> close and open it again. I have done the same test with MySQL Server on
>> my computer (localhost) and here I don't see no disconnection.
>>
>> Any other suggestions I may try here?
>>
>> --
>> Edhy Rijo
>> www.progytech.com
>> Bronx NY
>>
>>
>> "Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
>> news:ehl6iFIwGHA.1272@TK2MSFTNGP05.phx.gbl...
>>> Hi Bernhard,
>>>
>>> Thanks for the info, I am re-testing with the SQLSetPro right now, if
>>> that does not work I will check MySQL server properties.
>>>
>>> --
>>> Edhy Rijo
>>> www.progytech.com
>>> Bronx NY
>>>
>>>
>>> "Bernhard Sander" <fuchs@no.spam> wrote in message
>>> news:%23l69CEIwGHA.4216@TK2MSFTNGP06.phx.gbl...
>>>> Hi Edhy,
>>>>
>>>>> I am creating a connection to MySQL with the code below and using it
>>>>> in my CursorAdapter classes.
>>>>> lnConnectionHandle = SQLSTRINGCONNECT(lcConnectionString,.T.)
>>>>>
>>>>> Testing the application, I noticed that if I left one of my forms open
>>>>> without any user activity for some period of time the connection gets
>>>>> lost.
>>>>>
>>>>> What am I missing here?
>>>> Besides of some SQLSetProp settings in Foxpro, which are merely
>>>> settings at client side, there may be some settings at the server side.
>>>>
>>>> Regards
>>>> Bernhard Sander
>>>
>>>
>>
>>
>



Re: Connection Handle Disconnect? by Gregory

Gregory
Thu Aug 17 10:44:13 CDT 2006

Edhy,

do not forget to disconnnect when the object destroys

You return -1 if the connection cannot be made

or depending on how you intend to use it

if( !_SCREEN.oApp.ConnectionSql.Handle_get(@m.Handle) )
&& sorry
else
=sqlexec(m.Handle, ...
endif


define class ConnectionSql as ...
Handle = 0

function Handle_Get(Handle)
&& test and connect/reconnect if needed
if( connection cannot be made )
return .f.
else
Handle = m.this.Handle
return .t.
endfunc
enddefine

Gregory
_______
"Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
news:OegMgygwGHA.4972@TK2MSFTNGP05.phx.gbl...
> Hi Gregory,
>
> Good idea, will implement it and test.
>
> Thanks!
>
> --
> Edhy Rijo
> www.progytech.com
> Bronx NY
>
>
> "Gregory Adam" <GregoryAdam@PleaseReplyViaNewsGroup.com> wrote in message
> news:eSn2wecwGHA.4460@TK2MSFTNGP04.phx.gbl...
>> Edhy,
>>
>> Instead of _SCREEN.oApp.nConnectionHandle I would add a class to
>> _SCREEN.oApp that connects/reconnects/... when its connectionhandle is
>> accessed
>>
>> Something like _SCREEN.oApp.ConnectionSql.Handle
>>
>> Create the object and add it to _screen.oApp
>>
>> define class ConnectionSql as ...
>> Handle = 0
>>
>> function Handle_Access()
>> && test and connect/reconnect if needed
>>
>> return m.this.Handle
>> endfunc
>>
>> enddefine
>>
>> Gregory
>> ____
>> "Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
>> news:eMp0MTXwGHA.4200@TK2MSFTNGP04.phx.gbl...
>>> Well an update!
>>>
>>> I re-installed MySQL server on another server and downloaded the data to
>>> that server and did the same test, from my computer connected to that
>>> database using DNSless and the same problem, after 10-15 minutes of
>>> inactivity I could not open any other form until VFP crashed and had to
>>> close and open it again. I have done the same test with MySQL Server on
>>> my computer (localhost) and here I don't see no disconnection.
>>>
>>> Any other suggestions I may try here?
>>>
>>> --
>>> Edhy Rijo
>>> www.progytech.com
>>> Bronx NY
>>>
>>>
>>> "Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
>>> news:ehl6iFIwGHA.1272@TK2MSFTNGP05.phx.gbl...
>>>> Hi Bernhard,
>>>>
>>>> Thanks for the info, I am re-testing with the SQLSetPro right now, if
>>>> that does not work I will check MySQL server properties.
>>>>
>>>> --
>>>> Edhy Rijo
>>>> www.progytech.com
>>>> Bronx NY
>>>>
>>>>
>>>> "Bernhard Sander" <fuchs@no.spam> wrote in message
>>>> news:%23l69CEIwGHA.4216@TK2MSFTNGP06.phx.gbl...
>>>>> Hi Edhy,
>>>>>
>>>>>> I am creating a connection to MySQL with the code below and using it
>>>>>> in my CursorAdapter classes.
>>>>>> lnConnectionHandle = SQLSTRINGCONNECT(lcConnectionString,.T.)
>>>>>>
>>>>>> Testing the application, I noticed that if I left one of my forms
>>>>>> open without any user activity for some period of time the connection
>>>>>> gets lost.
>>>>>>
>>>>>> What am I missing here?
>>>>> Besides of some SQLSetProp settings in Foxpro, which are merely
>>>>> settings at client side, there may be some settings at the server
>>>>> side.
>>>>>
>>>>> Regards
>>>>> Bernhard Sander
>>>>
>>>>
>>>
>>>
>>
>
>