From: Chaz. <epr...@gm...> - 2006-05-09 14:35:12
|
I am writing a multi-thread application and would love to use SQLObject in it. To complicate matters, each of the threads use a different database (though all of them use Sqlite). What I am trying to understand is how to make sure each table uses the right database. My current thinking is to use a unique SqlHub object for each group of tables (that use the particular database). So I was thinking something like this (and please tell me how wrong I am !!!! It is better to find out now than to spend endless time debugging something that won't work and rewriting it!): foo = DBConnection(...) bar = DBConnection(...) class FoosTable(SQLObject) : _connection = foo ... class BarsTable(SQLObject) : _connection = bar .. Did I get it right or is there something else? BTW, is SQLObject thread safe (so long as we are dealing with different database files?) Peace, and thanks in advance Charles. |