House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

when do client variables update the db?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
jon hall
06/30/2003 04:26 PM

  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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jochem van Dieten
06/30/2003 04:47 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Calvin Ward
07/01/2003 08:04 AM

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 -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Matt Robertson
06/30/2003 04:34 PM

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 -------------------------------------------

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
jon hall
06/30/2003 04:44 PM

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.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Barney Boisvert
06/30/2003 04:45 PM

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 -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Matt Robertson
06/30/2003 05:09 PM

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 -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference