Wouldn't a named lock do what you need?

<cflock name="_lucene" type="exclusive" timeout="30">
   
</cflock>

Could set the timeout in seconds to more if need be?

Cheers
Gareth.

Dale Fraser wrote:
It is very unlikely that this operation is being run by more than one person
at a time, but it is possible. So i'm happy to just make them wait, it's
20-30 seconds.

Regards
Dale Fraser

http://learncf.com


-----Original Message-----
From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf
Of Haikal Saadh
Sent: Friday, 19 October 2007 3:18 PM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: Application Locking


Would a better way be to show a 'Joe Bloggs is running the payroll 
process, come back later' message when the second person tries to 
perform this task?

Would having all these locks make the next person doing this task wait, 
or will it make everyone wait?

Dale Fraser wrote:
  
What happens if I lock an application scoped variable.

 

I have an application that can perform a task, which would cause 
trouble if two people were doing that task at the same time.

 

So I thought I could either do it using an application lock block, but 
i'm not really sure if that would work. The operation takes 30 seconds 
or less, so i'd be happy for the next person to just wait until the 
application was ready.

 

The second method I had in mind would be to have

 

<cfloop _expression_="application.locked = true">

     <!--- Do nothing and just wait --->

</cfloop>

 

Not locked

 

<cfset application.locked = true />

     Do Task

<cfset application.locked = false />

 

How would you do this.

 

Regards

Dale Fraser

 

http://learncf.com

 


    





  


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to