I started to draw new polygons in a layer within an existing GeoPackage that I previously created. 

However, after editing **several layers**, I sometimes (apart that it doesn't happen when editing one single layer, it looks like a random phenomena) cannot save the layer and I get the error: 

```none
Errors: ERROR: feature(s) not added.

Provider errors: 
  OGR error creating feature: failed to execute insert : database is locked
```

The polygons drawn are then lost, which is pretty frustrating. 

I googled a lot and found [this rather old fix][1] which is apparently already applied in QGIS 3.12 (my version).

Any suggestion?

  [1]: https://github.com/qgis/QGIS/commit/548117769910a4373747899b99478835e5c65c5e