Em Quarta 07 Junho 2006 15:22, mulicheng escreveu:
> Is there a way with Turbogears to synchronize a specific method.  I
> have a method that will perform a specific operation in the database.
> It needs to be able to be called by any user at any time, but the
> requests need to operate one at a time.
>
> I could import Lock from threading.. but that doesn't seem like a very
> nice thing to do to cherrypy.
>
> Thoughts?

I'm a lot geared towards the database, so that things can be used in several 
systems with no change or with minimal work.

This being said, I'd add a flag somewhere and probably have a function on the 
database to perform the operation.  This function would check the lock and if 
it is not there perform the operation.  If it is there, then it could either 
return an error or keep checking the lock until it is gone and then do the 
operation again or return the results from the previous run (again, it 
depends on what you're doing). 

-- 
Jorge Godoy      <[EMAIL PROTECTED]>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to