Hi List, I've been trying to work out exactly how I can safely use the session object in a threaded application. I've read the session docs, and posts such as this one:
http://mail.google.com/mail/#search/label%3Asqlalchemy+session+threading/1259f8c18a4d2578 But I am struggling a little, but I think it may have more to do with the 'design' of the app. The app looks at a db table for 'events' to process. A threadpool periodically takes these mapped db objects and puts them into a list, and then threads pick up these tasks. Each thread has it's own session object. This is giving me all the usual MySQL threading type issues that others encounter. I have a hunch as to what the problem is (and is just a hunch, so apologies if totally wrong): because the 'queued' tasks are mapped dbobjects, they we're created in another session? Therefore they don't play well with the thread's local session? I have got it to work by using threading.lock() and a single session, but this goes against everything that I read about using sessions. Any help would be much appreciated, and please let me know if you need more information. Jules
-- You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en.
