SQLite Forum

In-memory database from sqlite file
Login
Even if you only append rows, you are in trouble when you happen to copy the database in the middle of a transaction, whether it is implicit or explicit.

Any insert, update or delete may affect more than one database page.

Rows are kept in a [BTree structure](https://www.sqlite.org/fileformat2.html#b_tree_pages), stored in pages.

Any modification will change a leaf page, some modifications will also change interior pages.

By copying in the middle of a transaction, you break the [atomicity](https://www.sqlite.org/atomiccommit.html) of the commit process. You may copy pages with states before and after modification. 

So, the resulting copy may be corrupt.

```
-- 
Regards,
Kees Nuyt
```