Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SESSIONTIMEOUT & CFLOCK TIMEOUT help

Status
Not open for further replies.

LongHorn

Programmer
Jun 20, 2001
30
US
I'm using MSFoxPro Visual Studio 6 as the database. Would someone explain the difference between SESSIONTIMEOUT anc CFLOCK TIMEOUT for me, please.

Below is the code in my Application.cfm. When I log out of my CF App, I guess I still have some kind of locks on the database, because when I try to modify the database, it won't let me. I have to wait for 15 minutes before I could modify the database.

<CFAPPLICATION NAME=&quot;nsrpims&quot;
CLIENTMANAGEMENT=&quot;Yes&quot;
SESSIONMANAGEMENT=&quot;Yes&quot;
SESSIONTIMEOUT=&quot;#CreateTimeSpan(0, 0, 5, 0)#&quot;
CLIENTSTORAGE=&quot;Registry&quot;>


<CFLOCK TIMEOUT=&quot;10&quot;
THROWONTIMEOUT=&quot;Yes&quot;
NAME=&quot;#Session.SessionID#&quot;
TYPE=&quot;ReadOnly&quot;>
 
Hey longhorn,

The sessiontimeout defines how long to keep the session alive after the visitor's last page request. If set for 15 minutes, this means that as long as the visitor clicks on a page within 15 minutes of the last request, his session will remain active. After 15 minutes from the visitor's last page request, the session will expire and if the visitor then requests another page, they will receive a new session and all previous session information is lost.

The cflock timeout defines how long CF will wait for another lock to finish. This means that when CF encounters a <cflock> tag, it will check to see if another thread has a lock (meaning another thread is running the same code). If there is another thread with a lock, the current thread will sit and wait for the other thread to finish and release the lock. If the other thread doesn't release the lock before the timeout period is reached, the current thread either errors out or proceeds past the lock depending on your &quot;throwontimeout&quot; setting.

I don't think either of these are causing your problem though. I suspect that the reason you can't access the database is because of a datasource setting in the CF administrator. When you create a datasource, the default setting for &quot;maintain database connections&quot; is checked (yes). In the past, I've found that this cause CF to maintain a lock on the database for a period of time after the last request and keeps you from being able to open the database externally. If you uncheck this setting (and possibly restart) CF, I think the lock will be cleared and you won't have the problem again.

Hope this helps,
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top