If you are using SQLObject where you have one
connection per thread , the cacheing of the uri in
connectionForURI stomps on the connections.
This happens for me when I am using SQLObject with
CherryPy and SQLite. On each thread start up, I create
a connectionHub object for that thread. If I use the
connectionForURI method, the connections get stomped
on, and I get tracebacks saying that the cursor is
being accessed by a thread other than the one that
created it. If I bypass that and use the deprecated
method of creating the connection directly with
SQLiteConnection(), it works fine.
If we are going to cache the uri's (Is there a good
reason to do this? Shouldn't a connection only be
generated once?), we need to have a method of sending a
thread id or something similar to the connectionForURI
method so that it gets cached correctly.
I would suspect that this will also cause major
problems for anyone who is trying to use one connection
per thread (I think you still need to do this with MySQL).
If you have any questions, you can reach me at
You can also read the following thread for more
Log in to post a comment.