I'm using the sqlite3
python module to write the results from batch jobs to a common .db
file. I chose SQLite because multiple processes may try to write at the same time, and as I understand it SQLite should handel this well. What I'm unsure of is what happens when multiple processes finish and try to write at the same time. So if several processes that look like this
conn = connect('test.db')
with conn:
for v in xrange(10):
tup = (str(v), v)
conn.execute("insert into sometable values (?,?)", tup)
execute at once, will they throw an exception? Wait politely for the other processes to write? Is there some better way to do this?