"Ben Sizer" <[EMAIL PROTECTED]> writes: > I have an application where various accesses to SQLObjects are done in > background threads as well as the main thread. I use MySQL for the > database and use sqlobject.util.threadinglocal in the background thread > as shown in the "Creating a background batch processing thread" topic > on this group. (If it made it into the docs, I don't see it.) > > This appears to work. However, threaded applications are notorious for > appearing to work, and then sporadically not working. I want to ensure > everything is safe, at least as far as doing the right thing with each > library is concerned. Are there any special considerations I need to > take into account? Do I need to use the woefully underdocumented > sqlobject.util.threadinglocal in my main thread too? Is a user's > Identity thread-safe? Is there anything SQLObject/MySQL/Turbogears > specific I need to know?
Back to when I started with TurboGears and when I needed something like that I coded the tasks as URLs and scheduled a job to access them and process their output. This looked to me at the time -- and today I have the same opinion -- that it was the simpler approach I could have and ensure that all behaved the same. This allowed to have several tasks running simultaneously without having to worry about how the app would see changes done outside of its usual environment since everything was the app itself. For some long running tasks -- I still haven't coded them -- I plan on having a redirect and refreshing the page with new status until I get the desired information (probably using some META trick since text browsers aren't JS-friendly). Maybe this might be your case as well. This also has the advantage of making tests simpler... -- 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?hl=en -~----------~----~----~----~------~----~------~--~---

