Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
YAQ on Connection Time out
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01465578
Message ID:
01465619
Views:
32
Here is a snippet of code that hopefully demonstrates the issue as I see it:
nConnHandle = SQLSTRINGCONNECT([DRIVER=SQL Server;SERVER=(local);DATABASE=MyDatabase;Trusted_Connection=Yes])
IF nConnHandle < 1
	=messagebox("Problem")
       return
ENDIF
SQLSETPROP( nConnHandle, "IdleTimeout", 1 )

WAIT "wait 2 min " TIMEOUT 140 

cSqlSelect = "select * from product"

lnResult = SQLEXEC(nConnHandle, cSqlSelect, "TEMP_CURS")
IF lnResult < 0
        =messagebox("Problem")
        return 
ELSE
	SELECT TEMP_CURS
	BROWSE 	
ENDIF
I thought that after time out of 2 minutes and with the Idle Timeout set to 1 min, I should get an error when trying to call SQLEXE() again. Let me know, please, if you see what I am missing.

>Can you post relevan code?
>
>>Still something does not work. I set the IdleTimeout to 1, wait more than 2 minutes, then call the SQLEXE() with the same handle and data is returned with no error.
>>
>>>Why do you think that it's expressed in seconds?
>>>
>>>>
>>>>Thank you, Gregory. But what I don't understand is when I set the IdleTimeout to 10 and then wait a minute (greater than 10 seconds) and then call SQLEXE() with the connection handle I get no error and the data is returned. The way I understand IdleTimeout (from you message and the VFP Help) is the handle obtained initially should be invalid and I should get an error. What am I missing?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform