Hi, I'm using SQLAlchemy in an application where I have multiple threads needing to talk to a database. I am using only the direct SQL contruction and querying API, none of the ORM stuff.
Currently, I create a single instance of my "persistence layer API", which makes a call to global_connect(), and optionally to default_metadata.create_all() (for tests). I then pass this instance to all the threads that need to talk to my database. When I then use the tables (defined at the module scope, hooked to the default metadata object) in a single-threaded context, everything works fine. However, if I switch to trying to use the persistence layer from another thread, I get the following exception: InvalidRequestError: This Compiled object is not bound to any engine. I am guessing that somewhere in the mix the engine information is severed from the metadata when jumping to the other thread, but I have no idea how to fix this problem. Can anyone give me pointers on how to get my threads talking to the database correctly? Thanks in advance, and thanks for the awesomeness of SA! - Dave --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
