> Hi. I am cflocking the call to a component method because I'm 
> passing in session variables, like so:
> 
> <CFLOCK SCOPE="SESSION" TIMEOUT="300" TYPE="exclusive">
>       <CFINVOKE COMPONENT="LHF" METHOD="updateStatus" 
>                               RETURNVARIABLE="mmhmm" 
> ILASTACTIONUSER="#session.userName#" ...>
> </CFINVOKE>
> </CFLOCK>     
> 
> If I set a default session variable in the method itself, do 
> I have to have a cflock inside the cffuntion too?

If you are locking the Session scope outside the component, there's no
reason you'd need to lock the Session scope within the component.

> I hope not, since the function does not seem to like cflocks in it

You should have no problem using CFLOCK within a CFFUNCTION tag. You would
probably want to rewrite it something like this, I think:

<cffunction ...>
        <cfargument ...>
        <cfset var ...>
        <cflock ...>
        ...
        </cflock>
        <cfreturn ...>
</cffunction>

However, in this specific case, I would recommend that you perform your
locking in the calling page.

>       <CFARGUMENT NAME="lastActionUser" TYPE="STRING" 
> REQUIRED="YES" DEFAULT="#SESSION.userName#">

In general, I'd recommend that you avoid explicitly referring to the Session
scope (or any other external scope) within your components and functions. If
the argument is required, there's no need to specify a default value.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized 
instruction at our training centers in Washington DC, Atlanta, 
Chicago, Baltimore, Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:208229
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to