I'm making a website using Cherrypy, and I'm passing an array of IDs to a page to delete from the database. I don't seem to be able to delete any.
All other SQL statements seem to work, but running my DELETE FROM MACHINE WHERE ID=1008
causes the page to fail to load, and after a while I get Lock wait timeout exceeded; try restarting transaction
.
def delete(self, table, paramater=""):
sql = "DELETE FROM {0}".format(table)
if paramater != "":
sql += " WHERE {0}".format(paramater)
print(sql)
self.cursor.execute(sql)
self.db.commit()
delete("MACHINE", "ID="+ids[0])
Structure: https://i.stack.imgur.com/lOhFV.jpg