Michael,

Thanks!  Using create_engine(..., poolclass=SingletonThreadPool) works 
perfectly, though  create_engine(..., pool_threadlocal=True) still showed 
similar database is locked on 'session commit'

FWIW, I do have a single engine, connection, and session in the 
application, as with (now):

    self.engine = create_engine('sqlite:///%s' % dbname, 
                                poolclass=SingletonThreadPool)
    self.conn   = self.engine.connect()
    self.session = sessionmaker(bind=self.engine)()
    self.metadata =  MetaData(self.engine)
    self.metadata.reflect()

I haven't been rigorous in checking that only one wxPython thread is using 
the connection, as the wx code has lots of wx.CallAfter() to allow 
callbacks from the networking library to call into wx code, which then 
might want to write into the database.   My suspicion is that this is the 
root cause of the issue.

Anyway, I very much appreciate the quick, helpful response and fantastic 
library.

--Matt 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/20EJ6t8trqsJ.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to