From: Tim L. <tl...@gm...> - 2005-10-14 01:43:55
|
On 10/13/05, Alan Littleford <al...@ja...> wrote: > > Well, I must be just having a bad day. Still exploring SQLObject which lo= oks > really nice but is giving me grief: [...] > ProgrammingError: SQLite objects created in a thread can only be used in = that sa > me thread.The object was created in thread id 3144 and this is thread id = 492 > This is a limitation of SQLite, and it means just what it says. The fix is to use ConnectionHub, which can manage the thread-local storage for you: hub =3D ConnectionHub() class SomeObject(SQLObject): _connection =3D hub Then, at the beginning of each thread function: hub.threadConnection =3D connectionFromURI('yourConnectionUri') -- Tim Lesher <tl...@gm...> |