Hi, guys!
I was just sending a new e-mail to the list when I saw this thread.
I was having problems recently with sqlobject+sqlite in CherryPy
and Apache (traceback attached), and noticed they started after a
change from sqlobject.sqlite.sqliteconnection.SQLiteConnection (which
was issuing deprecation warnings) to sqlobject.connectionForUri
(recommended by those same warnings).
Anyway, after I changed back to using the deprecated function it
magically worked again.
I then went to look at the source code, to see if there was
anything different in connectionForURI. I saw that it tries to do
some caching, and ends with this:
# @@: Do we care if we clobber another connection?
self.cachedURIs[uri] = conn
return conn
Can someone please tell me if connectionForURI is really doing
what it was supposed to do?
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 105,
in _run
self.main()
File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 254,
in main
body = page_handler(*virtual_path, **self.params)
File "./servidor.py", line 275, in listar
dados = [dict(documento_id=f.documento_id,
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7rc1-py2.4.egg/sqlobject/sresults.py",
line 149, in __iter__
return iter(list(self.lazyIter()))
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7rc1-py2.4.egg/sqlobject/sresults.py",
line 157, in lazyIter
return conn.iterSelect(self)
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7rc1-py2.4.egg/sqlobject/dbconnection.py",
line 361, in iterSelect
select, keepConnection=False)
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7rc1-py2.4.egg/sqlobject/dbconnection.py",
line 683, in __init__
self.cursor = rawconn.cursor()
ProgrammingError: SQLite objects created in a thread can only be used in that
same thread.The object was created in thread id 1126607792 and this is thread
id 1185328048
On 05/06/2007, at 08:02, jonhattan wrote:
I've read in main sqlobject doc: "SQLite may have concurrency issues,
depending on your usage in a multi-threaded environment."
--
Humberto Diógenes
Diginet Brasil
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss