iameru / mschleuder

ein Tool für nicht nur CSA's / SoLaWis / Kollektivbetriebe die ihre Erzeugnisse: - an all ihre Mitglieder verteilen - an verschiedene Stationen/Lieferorte - mit halben und ganzen Anteilen
https://iameru.github.io/mschleuder/
GNU General Public License v3.0
3 stars 0 forks source link

product unit issue #9

Closed iameru closed 8 months ago

iameru commented 2 years ago

cant edit product.

clicked a bit around, changing a product into one without units and back, made a distribution. now no edit, probably a commit missing:

sqlite3.OperationalError: database is locked

when asking for ciurrent distribution in context processor. finer traceback:

sqlalchemy.exc.OperationalError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely)
(sqlite3.OperationalError) database is locked
[SQL: DELETE FROM product_units WHERE product_units.unit_id = ? AND product_units.product_id = ?]
[parameters: ((1, 2), (3, 2), (2, 2))]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
iameru commented 2 years ago

the finer traceback probably is not the source of this bug.

when going into distribution:
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: INSERT INTO distribution (created, updated, in_progress, finalized, date_time) VALUES (?, ?, ?, ?, ?)]
[parameters: ('2022-10-06 19:38:00.000000', None, 1, 0, '2022-10-06 19:38:00.000000')]
(Background on this error at: https://sqlalche.me/e/14/e3q8)

but with the point

File "/home/v/wrk/ms/ms/distribution/views.py", line 47, in trigger

db.session.commit()
iameru commented 2 years ago

could not reproduce so far.

must be something missed which locks the database