Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The article mentions this workflow:

"Let’s now execute the script multiple times, one per set of parameters, and store the results in the experiments.db SQLite database... After finishing executing the experiments, we can initialize our database (experiments.db) and explore the results."

Be warned that issuing queries while DML is in process can result in SQLITE_BUSY, and the default behavior is to abort the transaction, resulting in lost data.

Setting WAL mode for greater concurrency between a writer and reader(s) can lead to corruption if the IPC structures are not visible:

"To accelerate searching the WAL, SQLite creates a WAL index in shared memory. This improves the performance of read transactions, but the use of shared memory requires that all readers must be on the same machine [and OS instance]."

If the database will not be entirely left alone during DML, then the busy handler must be addressed.



None of these are a problem for the workload discussed.

When I am working with sqlite I am more likely accessing it from a single machine.

And in this case of ML, most likely from 1 process and by running multiple times in serial.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: