title: SQLAlchemy and SQLite: database is locked
body: <p>I have a python script which uses the latest sqlalchemy.
  When i use sqlite,only sqlite, other db works well, i get the following error:</p>
  
  <pre><code>sqlalchemy.exc.OperationalError: (OperationalError) database is locked u'SELECT blabla....
  </code></pre>
  
  <p>Any hint?</p>
  
  <p>Example from my code (simplified), i have several methods like this, to select, update and delete things:</p>
  
  <pre><code>class MyDb(object):
      def __init__(self):
          engine = create_engine("sqlite:///file", poolclass=NullPool, pool_threadlocal=True)
          engine.pool_size=1
          engine.pool_timeout = 60
          self.sess = sessionmaker(bind=engine)
  
      def del_stuff(self):
          sess = self.sess()
          sess.query(Stuff).delete()
          try:
              sess.commit()
          except:
              sess.rollback()
  
      def set_stuff(self, id, bar):
          sess = self.sess()
          sess.query(Foo).get(id).bar = bar
          try:
              sess.commit()
          except:
              sess.rollback()
  </code></pre>