Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
YAQ on Connection Time out
Message
From
23/05/2010 14:26:11
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01465578
Message ID:
01465642
Views:
31
The way I understand it is the vfp will disconnect after the IdleTimeOut, ie closing the connection
But after that, if you to any operation that is using the handle, it automatically reconnects



>My problem is that after the time out expires, I still get access to the SQL Server using the same connecting handle. And I was expecting an Access Denied or some other problem.
>
>The guy in the foxite message had a problem that after the time out expired he was getting access denied message. This is what I expected too but not getting.
>
>But I will re-read the messages on foxite again to see if it sheds the light on my problem.
>
>Thank you.
>
>>I think this explains it:
>>http://www.foxite.com/archives/application-roles-sqlserver-0000061406.htm
>>
>>His complaint is different but it demonstrates what happens after the IdleTimeOut expires -
>>
>>
>>>Here is a snippet of code that hopefully demonstrates the issue as I see it:
>>>
>>>
;>>nConnHandle
> = SQLSTRINGCONNECT([DRIVER=SQL Server;SERVER=(local);DATABASEMyDatabasee;Trusted_Connection=Yes])
>>>IFnConnHandlee < 1
>>>	messageboxx("Problem")
>>>       return
>>>ENDIF
>>>SQLSETPROP(nConnHandlee, IdleTimeoutt", 1 )
>>>
>>>WAIT "wait 2 min " TIMEOUT 140 
>>>
>>cSqlSelectt = "select * from product"
>>>
>>lnResultt = SQLEXECnConnHandlee,cSqlSelectt, "TEMP_CURS")
>>>IFlnResultt < 0
>>>        messageboxx("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 postrelevann code?
>>>>
>>>>>Still something does not work. I set theIdleTimeoutt 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 theIdleTimeoutt 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 understandIdleTimeoutt (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?
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform