title: Locking sqlite file on NFS filesystem possible?
body: <p>Let's say there are two python scripts that want to write data to the same table which is stored in an SQLite file using the <code>sqlite3</code> module. The SQLite-file is stored on an NFS filesystem. In the <a href="http://www.sqlite.org/faq.html#q5">SQLite-FAQ</a> I read:</p>
  
  <blockquote>
    <p>SQLite uses reader/writer locks to control access to the database.
    [...] But use caution: this locking mechanism might not work correctly
    if the database file is kept on an NFS filesystem. This is because
    fcntl() file locking is broken on many NFS implementations. You should
    avoid putting SQLite database files on NFS if multiple processes might
    try to access the file at the same time.</p>
  </blockquote>
  
  <p>Does this mean it is not possible at all or is there some way to ensure that one process waits until the other is done?</p>
  
  <p>The INSERTs are not complex. Just some:</p>
  
  <pre><code>INSERT_STATEMENT = "INSERT INTO some_table (row, col, val) VALUES (?, ?, ?)"
  connection.executemany(INSERT_STATEMENT, triples)
  </code></pre>
  
  <p>And the inserted sets are disjoint.</p>
  
  <p>A further question: Does the NFS-Problems occure when two processes try to write to the same table or when they try to write to the same database (which is a file)? Would it be a workaround to let each process create its own table in the same database (file) and write to that?</p>