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

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

ColdFusion MX and Locking

  << 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:
Bryan F. Hogan
05/22/2003 09:52 AM

Hello all, I have had it stated to me that there is no need to use locking in CFMX. And I have also heard that you only need to lock file and com access and not the shared scopes. And I have heard that it is required on both shared scopes and file/com access. Could someone explain to me the "truth". Thanks Bryan

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Massimo Foti
05/22/2003 09:56 AM

> Could someone explain to me the "truth". > You may try this: http://www.macromedia.com/support/coldfusion/ts/documents/tn18235.htm ---------------------------- Massimo Foti Certified Dreamweaver MX Developer Certified Advanced ColdFusion MX Developer http://www.massimocorner.com/ ----------------------------

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan F. Hogan
05/22/2003 10:00 AM

Ah, and the truth be told. Great thanks Massimo! > Could someone explain to me the "truth". > You may try this: http://www.macromedia.com/support/coldfusion/ts/documents/tn18235.htm ---------------------------- Massimo Foti Certified Dreamweaver MX Developer Certified Advanced ColdFusion MX Developer http://www.massimocorner.com/ ----------------------------

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Raymond Camden
05/22/2003 10:09 AM

My only objection to this article is the statement that recommendations from previous versions have not changed. While the article does describe race conditions and why you need to lock them, it makes it seem like the old rule ("ALWAYS LOCK OR YOU WILL DIE!" ;) is still true. This is simply not the case. If you are using Application vars, for example, as pseudo-constants: <cfif not isDefined("application.foo")>   <cfset application.foo = 1> </cfif> <cfoutput>#application.foo#</cfoutput> There is no reason to lock these lines. ======================================================================== === Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com) Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia) Email    : jedimaster@mindseye.com Blog     : www.camdenfamily.com/morpheus/blog Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda ----- Excess quoted text cut - see Original Post for more ----- http://www.macromedia.com/support/coldfusion/ts/documents/tn18235.htm ---------------------------- Massimo Foti Certified Dreamweaver MX Developer Certified Advanced ColdFusion MX Developer http://www.massimocorner.com/ ----------------------------

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan F. Hogan
05/22/2003 10:13 AM

Does the same hold true with Session vars? My only objection to this article is the statement that recommendations from previous versions have not changed. While the article does describe race conditions and why you need to lock them, it makes it seem like the old rule ("ALWAYS LOCK OR YOU WILL DIE!" ;) is still true. This is simply not the case. If you are using Application vars, for example, as pseudo-constants: <cfif not isDefined("application.foo")>   <cfset application.foo = 1> </cfif> <cfoutput>#application.foo#</cfoutput> There is no reason to lock these lines. ======================================================================== === Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com) Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia) Email    : jedimaster@mindseye.com Blog     : www.camdenfamily.com/morpheus/blog Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda ----- Excess quoted text cut - see Original Post for more ----- http://www.macromedia.com/support/coldfusion/ts/documents/tn18235.htm ---------------------------- Massimo Foti Certified Dreamweaver MX Developer Certified Advanced ColdFusion MX Developer http://www.massimocorner.com/ ----------------------------

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Raymond Camden
05/22/2003 10:18 AM

I would say so. It depends on the usage. For example, if on login I do session.name="foo" session.favmoviue="star wars" There is no reason to lock. However, and as you see in the article, when working with a variable where a race condition may occur, you would want to use locks. Another example: <cflock scope="session" type="exclusive" timeout=3>   <cfset session.pageCount = session.pageCount+1> </cflock> As you can guess, this code keeps track of how many pages the user has viewed. If you are using MX, you make things a bit easier with a UDF: <cfset increasePageCount()> <cffunction name="increasePageCount" returnType="void" output="false">   <cflock etc   ..   </cflock> </cffunction> Although that _may_ be a bit of overkill. ;) ======================================================================== === Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com) Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia) Email    : jedimaster@mindseye.com Blog     : www.camdenfamily.com/morpheus/blog Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan F. Hogan
05/22/2003 10:21 AM

I understand, thanks. I would say so. It depends on the usage. For example, if on login I do session.name="foo" session.favmoviue="star wars" There is no reason to lock. However, and as you see in the article, when working with a variable where a race condition may occur, you would want to use locks. Another example: <cflock scope="session" type="exclusive" timeout=3>   <cfset session.pageCount = session.pageCount+1> </cflock> As you can guess, this code keeps track of how many pages the user has viewed. If you are using MX, you make things a bit easier with a UDF: <cfset increasePageCount()> <cffunction name="increasePageCount" returnType="void" output="false">   <cflock etc   ..   </cflock> </cffunction> Although that _may_ be a bit of overkill. ;) ======================================================================== === Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com) Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia) Email    : jedimaster@mindseye.com Blog     : www.camdenfamily.com/morpheus/blog Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda ----- Excess quoted text cut - see Original Post for more -----


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

Search cf-talk

May 25, 2013

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