|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
when do client variables update the db?
Does anyone know offhand if updates to a client variable (stored injon hall 06/30/03 04:26 P jJochem van Dieten 06/30/03 04:47 P Couldn't you test this with the following somewhere in the page followingCalvin Ward 07/01/03 08:04 A Immediately. I can set a cvar on Line 1 and use it in code starting on Line 2.Matt Robertson 06/30/03 04:34 P Sorry, my question was worded badly...knew it was as soon as I sentjon hall 06/30/03 04:44 P cf gets requestBarney Boisvert 06/30/03 04:45 P Just after OnRequestEnd.cfm runs... i.e. immediately post request.Matt Robertson 06/30/03 05:09 P Does anyone know offhand if updates to a client variable (stored in a db) take place immediately as they are set, or after the page has finished executing? -- jon mailto:jonhall@ozline.net j > Does anyone know offhand if updates to a client variable (stored in > a db) take place immediately as they are set, or after the page has > finished executing? They are written to storage at the end of the request (for every type of storage). Jochem Couldn't you test this with the following somewhere in the page following your set statement? SELECT * FROM CDATA WHERE data like '%#variablename#%' And app = '#application.applicationname#' and cfid = '#cfid#:#cftoken#' Sorry, not near my app server to try this atm. - Calvin ----- Excess quoted text cut - see Original Post for more ----- Immediately. I can set a cvar on Line 1 and use it in code starting on Line 2. It may not be committed to disk right then and there, but you can use it immediately. The only exception to this I found was a bug in CFMX (initial release... haven't tried it recently), where if a cvar was set on a template, and that template had an iframe then the cvar was not available in the iframe unless you refreshed it (after the error was thrown). The same operation runs fine in CF 4.5. ------------------------------------------- Matt Robertson, matt@mysecretbase.com MSB Designs, Inc. http://mysecretbase.com ------------------------------------------- Sorry, my question was worded badly...knew it was as soon as I sent it. What I'm after is, when does it actually get committed to the disk? -- jon mailto:jonhall@ozline.net Monday, June 30, 2003, 4:31:45 PM, you wrote: MR> Immediately. I can set a cvar on Line 1 and use it in code starting on Line 2. MR> It may not be committed to disk right then and there, but you can use it immediately. MR> The only exception to this I found was a bug in CFMX (initial release... haven't tried it recently), where if a cvar was set on a template, and that template had an iframe then the cvar was not MR> available in the iframe unless you refreshed it (after the error was thrown). The same operation runs fine in CF 4.5. cf gets request cf querys cvar store (registry, db, whatever) cf runs template cf updates cvar store I'm not sure where cf returns the generated content to the web server (or directly to the client) in relation to when it updates the client variables. If I had to guess, I'd say it returns after the update, but that's only a guess. The update query can be turned off in CFMX (perhaps earlier?) if no actual client variables were updated, and all that would change is hitcount and lastvisit. Give a little performance bonus if you're mostly read-only, but having lastvisit around is nice for some things. cheers, barneyb --- Barney Boisvert, Senior Development Engineer AudienceCentral bboisvert@audiencecentral.com voice : 360.756.8080 x12 fax : 360.647.5351 www.audiencecentral.com ----- Excess quoted text cut - see Original Post for more ----- Just after OnRequestEnd.cfm runs... i.e. immediately post request. Try this code: application.cfm --------------- <cfapplication name="test0610" sessionmanagement="no" clientmanagement="Yes" applicationtimeout="#CreateTimeSpan(0,0,30,0)#"> <ol> <li><cfoutput>#client.lastvisit#</cfoutput> index.cfm: ---------- <li><cfoutput>#client.lastvisit#</cfoutput> OnRequestEnd.cfm: ----------------- <li><cfoutput>#client.lastvisit#</cfoutput> </ul> <cfoutput>#createODBCDateTime(now())#</cfoutput> You'll get all the same (old) values in client.lastvisit, the current time in the now value and the now value will be shown in lastvisit on your refresh. ------------------------------------------- Matt Robertson, matt@mysecretbase.com MSB Designs, Inc. http://mysecretbase.com ------------------------------------------- Reply-To: cf-talk@houseoffusion.com Date: Mon, 30 Jun 2003 16:43:00 -0400 ----- Excess quoted text cut - see Original Post for more -----
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||