Hi Michael,

There are a couple of issues with copying my persistent variable to the
request scope. 

First of all, in this particular case, the main reason for persisting the
object is purely performance. Its an object that gets extremely often and
persisting it saves a lot of milliseconds. So copying it on every request
would defeat the whole purpose of persisting it. 

Secondly, it's not so easy to clone CFCs. You would need to write a custom
function that again would be killer to performance.

Thanks for the suggestion anyhow,
Baz



-----Original Message-----
From: Michael Traher [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 18, 2006 11:42 AM
To: CF-Talk
Subject: Re: CFCs, TAGs, Locking

maybe you could make a copy of your object in the request scope
onRequestStart and then work with
request.OrderObj


On 1/18/06, Baz <[EMAIL PROTECTED]> wrote:
>
> Let's say you have a display TAG called DisplayOrder.cfm that accepts as
> an
> argument OrderObj.cfc. Basically the TAG displays the contents of the CFC.
>
> Let us also say that in 1 particular case you are passing an OrderObj that
> is stored in the application scope to the TAG.
>
> Where do you employ locking to avoid race conditions? It can't be within
> the
> TAG because sometimes locking is not necessary. So do you lock the entire
> call to the tag like so:
>
> <cflock>
>   <Order:Display OrderObj="#application.OrderObj#">
> </cflock>
>
> Does that even lock everything that happens within the tag and stop race
> conditions? Isn't it extremely inefficient to lock a potentially huge
> chunk
> of code when only a couple of lines really need to be locked? How do
> people
> generally handle this?
>
> Cheers,
> Baz
>
>
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:229878
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to