title: Python Sqlite Concurrent access
body: <p>I have a scenario where a third party application scans a folder and triggers my python script/generated EXE for the number of times (yes! number of separate processes) for the number of files that are in the folder. 
  My script/application writes the path of the file to a local sqlite database, calls the next application and exits. 
  My script/application takes care that it calls only one instance of the next application. But nothing can be done of the third party application that calls my script.</p>
  
  <p>The ISSUE
  Sometimes more than 1000 instances of my script/application can be called at the same time resulting in almost 1000 concurrent connections to the local sqlite database. 
  Due to the limited number of concurrent connections possible with sqlite, some of the processes are getting a "database is locked" Exception. This results in some of the file names NOT being written to the database
  We came up with a work around for this. We write in the database in an infinite loop. On encountering the exception, we make the thread sleep for say 50 milliseconds and try again till such time that the write works. I know that this is not a clean approach.</p>
  
  <p>Is there a better way of doing this? How do I handle 1000 may be 10000 or may be more concurrent connections and yet each script succeeds?</p>