You cannot have multiple threads share the same db. That conflicts with web2py thread pooling mechanism. Even if it did not, we do not know the db driver it thread safe. Each thread must have it's own db=DAL() connection.
On Monday, 7 May 2012 05:21:17 UTC-5, Samuel Mac wrote: > > First of all, I've been searching other google group theads and they help > me doing all I wanted but now I'm stuck. > I was looking for getting some hardware information from a computer using > 3 threads. This threads save the info in the Database. To do that i follow > the instructions founded in this two forum threads: > - > https://groups.google.com/forum/?fromgroups#!searchin/web2py/db$20module/web2py/HbZh7Bbk5RI/sWn0rZaQDRgJ > - http://osdir.com/ml/web2py/2012-02/msg01692.html > > I tryed to pass the DB connection to the class using the __init__ and the > other way, using the current.db method, but I'm getting the same error: > raise errorclass, errorvalue > InterfaceError: (0, '') > > Despite my query is very simple: row = db(db.device).select() > > Are threads unable to use DB connection? >

