digitalpalidictionary / dpd-db

13 stars 8 forks source link

Unexpected DPD -journal file #22

Open gambhiro opened 8 months ago

gambhiro commented 8 months ago

When the Simsapa app is using the DPD Python functions to render words, the DPD db is modified and a -journal file is created.

Different parts of an app may open simultaneous sqlite sessions to the same db, and that's ok when these are read-only operations, but simultaneous writes can cause the db to be locked and throw runtime errors.

Another source of crashes can be a situation where the app's main assets are installed in a read-only folder (such as a system folder instead of a user folder) and the unexpected journal write operation throws an error.

2024-01-20_06-45

You probably did not intend modifying the db during rendering templates. What it could be is that somewhere a word is retrieved as an SQLAlchemy object, one of its attributes are assigned (like a variable assignment while calculating something), but the change was not intended to be permanent and hence not committed to the db.

It would be best to find where this happens and refactor it without the SQLAlchemy assignment, so that the DPD db remains unchanged during template rendering.