title: OperationalError: Database is locked in Sqlite3 with peewee
body: <p>There is foreign relationship between ExtensionData and DailyData. I read the ID of ExtensionData to input this into DailyData. But I'm greeted with an OperationalError database is locked when I do it like this. How do I avoid that?</p>
  
  <pre><code>def create_ext_data(link, nr_users, downloads, rating, nr_reviews):
      """
      """
      db.connect()
      with db.transaction():
          link_to = ExtensionData.get(ExtensionData.link == link).id
          DailyData.create(link_to=link_to, nr_users=nr_users, nr_reviews=nr_reviews,
      downloads=downloads, rating=rating)
      db.close()
  </code></pre>