Lot of code, the event_handling looks better. Committing transatcion in SQLite is - obviously - a good thing