> > > We tried to switch from SingletonThreadPool (which raises errors, > > sometimes) to StaticPool... we'll see what happens. The problem is > > that this error is not systematically raised and it seems that it is > > raised when multiple threads are accessing the db. > > StaticPool can't be used for a multithreaded application, a connection can > only be used in one thread at a time. pysqlite specifically should be > even preventing that connection from being used in any thread in which it > wasn't created. If you're using a file based database, you should be on > NullPool - pooling for SQLite isn't really appropriate. > > I do want to go to NullPool but, as mentioned earlier, it raises an Operational error: no such table. I'm not familiar with low level implementation of db layers (that's why i found sqlalchemy so useful in that it encapsulates the details). Our code just creates one instance of the OrmManager and then everytime a db access is needed, we ask it a session for that.
Example code is: orm = OrmManager(....) session = orm.get_session() my_obj = session.query(....) my_obj.attribute = 'new value' session.commit() I can see an issue here, talking to you. We used the SingleThreadedPool with pool_size=50. But looking at our code, it seems that we never free the created sessions (session.close() ). Are they garbage collected ? Do we need to explicitly call session.close() ? The problem occurs when multiple access are done, we may use all the sessions available before the garbage collector runs... -- 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/-/mQFivU-Be4UJ. 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.