You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add DB transactions and graceful close
Introduce transactional support to Database: add contextmanager transaction(), a _tx_depth counter, and _commit() to defer commits until outermost transaction completes (with rollback on exception). Replace direct conn.commit() calls with _commit() across methods. Add safe close() and update __del__ to use it; handle minor variable rename (numberOfImages -> number_of_images) and import contextmanager. Use the new transaction() in main.addProduct to group product/category/image writes atomically, and add a GUI on_close handler to close the DB connection on app exit.